- Home /
Other
Animation with different color for layers
I have 4 players which are identical except for the color of certain part of the sprite. In order to reduce the amount of work I made generic sprites and separate them in 2 layers, one with the parts which will not change and one with the parts which will change color. The problem is that I have issue with animating the players.
I added a child to my player prefab. It contains a sprite renderer and an animator controller. I use the same animator controller for the parent and for the child to just have to modify one time the structur if needed. When the players are instantiate, the color of the child's sprite renderer is changed, so the color of the animation is changed. I have also a script which create AnimatorOverrideControllers to choose the the animations in the animator states (it allows to reduce the number of state).
This method achieve the purpose I want, but as there is 2 animator controllers, the animations are not well synchronized. So, is there a way to do what I want but with which animations are well synchronized ?
Answer by Firox_ · Feb 06, 2020 at 01:28 PM
Finally I just used animation layers to synhronize my animations. But because of that I'm forced to make animations frame by frame at hand. I think it should be better if there was a setting in the animation layer which would allow us to choose on which child GO we want to use the animation. It would far more efficient in term of work speed. But maybe it would be inefficient in term of memory cost or others and that's why it doesn't exist...
Follow this Question
Related Questions
Why when creating new animator controller for the character the character is not walking right ? 0 Answers
How can i check if animation has finished playing if the object have no animator attached ? 1 Answer
Animator Trigger Not Working 1 Answer
How to have a collider inactive only during attack animation and not during 'charging' animation? 1 Answer
Need Help Syncing door animations between all clients! 0 Answers