- Home /
Parent animator controller overrides child's animations
Hey, guys!
I have an animator that animates a whole canvas and his child's. Some of the children are buttons that also have an animator component which includes the button pressed animations. The problem is that the button animations won't play. Their animator component show the triggers and the transitions beeing activated but there is no animation to be seen whatsoever. The parent animator just overrides the child's scale. I tried a lot of things but nothing worked so far.
Attach component on the parent and then play child animation from parent animator.
Answer by Refentse · Mar 06 at 04:20 PM
You should add an animation property to your canvas's idle animation so that it knows exactly what to animate. If it does not know what property specifically to animate, then it will control the animations for all properties of itself and its children. And as a result, the children's own animations will not play.
You can add an empty anination property to the animator .e.g. Add the 'Position.z' property of the RectTransform, but leave the property with its default values. This way the canvas's animator will try to "animate" the Z Position of the RectTransform and all the child animators will be free to play the animations that you want them to play.