- Home /
Removing rgb channels from material animation turns color black
I'm using an animation to change the alpha channel of a material to get a fade effect.
When you add the color property of the material in the animation it adds all 4 rgba channels. You can then remove rgb and only have the alpha channel to animate. When this animation runs it will set the rgb values all to 0, turning the material black.
You can just not remove rgb to fix this issue but then there is another problem. It will set rgb to the initial values of the material color. If you change the material color afterwards, the animation will be unchanged and still contain that initial color. So I would have to update all those animations by hand.
I'm using the standard shader in transparent rending mode and Unity 5.5.0f3.
Edit: Made a test project to demonstrate this.
Answer by tarhh · Jan 14, 2018 at 03:57 PM
I got the same problem and fixed it by adding an useless state in the animator with a clip that animate the 4 properties of the color. The state have no transition to it and the clip is a simple animation from white to white, but any color animation will work.
I'm new to Unity so I can't be sure if it's a bug or if I'm doing something wrong.
Your answer
Follow this Question
Related Questions
send csv colour values to multiple meshes 1 Answer
Making an object change color after Animation Ends 0 Answers
Animating GUIText material properties 0 Answers
Alpha component not changing 0 Answers