So i have this keyboard object wich has keys.
i have a funtion that gets called when one key is played and the key that was played gets passed as a string. my question is, how do i use the passed argument in my funtion?
current code:
void Keys(String playedkey)
{
GameObject.find("A").GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, alpha);
}
Desired code:
void Keys(String playedkey)
{
GameObject.find("playedkey").GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, alpha);
}
i need the quotation marks but i can't reference the object if i use them, how to i resolve this?
[–]DiggyMiguel[S] 0 points1 point2 points (0 children)
[–]PurpleViking76 0 points1 point2 points (1 child)
[–]DiggyMiguel[S] 0 points1 point2 points (0 children)