Tag Info

New answers tagged


Turns out I the easy, normal etc. variables were just the Animators, not the whole image. I just added another set of variables with the images in and it worked fine. Here is the final code: public EnemyBehavior enemyBehavior; public bool[] difficultySelected; public Animator easy; public Animator normal; public Animator hard; ...


You can write: color.a = 1f; // value between 0 and 1, where 1 is opaque //Resetting the colors normal.GetComponent<SpriteRenderer>().color = color; hard.GetComponent<SpriteRenderer>().color = color; expert.GetComponent<SpriteRenderer>().color = color;

Top 50 recent answers are included