Search Unity

Question Animated object on timeline doesn't follow parent

Discussion in 'Timeline' started by ProfFailington, Nov 22, 2022.

  1. ProfFailington

    ProfFailington

    Joined:
    Jun 18, 2021
    Posts:
    6
    I have an 2 objects on the timeline. One parented to another. I play an animation on both, but the child object doesn't follow the parent and just plays the animation in place.

    Is there a way to make this work that doesn't involve making the child object's animation duplicate the movement of the parent?

    Edit:
    After looking into it some more, the transform of the object doesn't update while it's animating. I guess this is why the children don't move with it. Is this intended behaviour?
     
    Last edited: Nov 22, 2022
    kana1939 likes this.
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I am not sure the exact problem, but if you have two animators trying to update the same object, one of them wins and the other loses. I never dug into it precisely, but I was wondering if the parent and child objects both had animator components. I have animated a parent container object and a child character object and it worked - but both had their own animator component. Just wondering if its something like that.
     
  3. ProfFailington

    ProfFailington

    Joined:
    Jun 18, 2021
    Posts:
    6
    Thanks for the reply. They both have their own animator component, so it's not that.

    I've noticed that even if i disable the animation on the child object, it still doesn't follow the parent when it animates. Still not sure what could be causing it. :/
     
    Last edited: Nov 23, 2022
  4. ProfFailington

    ProfFailington

    Joined:
    Jun 18, 2021
    Posts:
    6
    Ok I figured it out. I'll leave this here in case anyone else comes across the same issue.
    The parent object had root motion, and the child object was a child under the parent object, but not under the parent object's root object. Once I moved it in there it works as expected.

    You live and learn!