Search Unity

Question Playing child animation from parent animator.

Discussion in 'Animation' started by Roulace, Mar 1, 2021.

  1. Roulace

    Roulace

    Joined:
    Feb 5, 2017
    Posts:
    27
    I have a parent empty game object that is currently holding 40 spheres. The spheres represent electrons. They each have an idle "shake" animation attached to them. The parent empty game object has an animator and an animation that moves some of the electrons when a button is pushed.

    Originally, I had an animator on every electron for the particle shake. Any electron assigned to move by the parent empty game object wouldn't run the "shake" animation. I tried removing the animator from each of the child objects thinking I could call the animation using the parent animator.

    I can't attach the "shake" animation to the parent since that would cause all the electrons to shake the same direction. I would also rather not attempt to hand-animate 40 electrons within the parent animator. Is there some way to call the animation on a child object using the parent animator?
     
  2. ZenOwl

    ZenOwl

    Joined:
    Oct 14, 2018
    Posts:
    5
    I have the same question. I want my particle system (child) rotation animation to start when the sphere (parent; in my case its position is constrained to parent) is called to animate. This should be simple...like somehow call start child animation when the parent animation starts...but I am new to C# and to unity (my xp is intermediate C++ and Xcode). So how could we have a parent call child animation?

    For you, @Roulace, did you ever figure this out? Hopefully in a year you did, if so, can you post what you did??

    My thought (for others with this question now) would be that you just remove the non shaking electrons from the parent. Have two parents: Shaker, Non-Shaker so when the button is pushed only those under the parent "shaker" move? Simplistic, and you might need to have the button also "show" the non shakers if they are supposed to appear, too, when your button is pressed. Not knowing your whole deal, that's my idea.