2
\$\begingroup\$

Animation is changing the color of an UI Image but the color only changes only in the inspector but not Game/Scene view.

In this video I demonstrate the problem clearly.

\$\endgroup\$
3
  • \$\begingroup\$ Without seeing your code we can't help you. Best-guess is that the material used to render the UI image ignores the color. If you manipulate it in the inspector, not during run-time, do you get the desired effect? \$\endgroup\$ Dec 10 '15 at 20:17
  • \$\begingroup\$ I don't think you need the code for this one. In the code I simply run the Play on the animation with the animation name. As for manipulating the color manually, it works both run-time and not run-time. As for the material, I use none. \$\endgroup\$
    – ZenVentzi
    Dec 10 '15 at 20:23
  • \$\begingroup\$ GUI images still have a material and shader, even if its hidden in a black box. I do not know what is wrong though. \$\endgroup\$ Dec 10 '15 at 20:26
0
\$\begingroup\$

You need to change your Material on the Image to something that has the "Sprites-Default" shader so it can react to the changes in the color.

If you don't have the Material you need, here's a quick way to create one that would work for what you're trying to do: Simple Sprite Material Creation. Under "Shader" just select "Sprites > Default".

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.