Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Animation played via Timeline and animation played via Animation window are very different?

Discussion in 'Timeline' started by StarManta, May 15, 2019.

  1. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,115
    I'm trying to integrate some animations into the Timeline (which I haven't done before) and the results are really bizarre and unexpected, and I'm wondering if anyone has some insight as to why they're behaving this way.

    The setup is, a PlayableDirector on the parent object, and AnimatorController on the child object. When I select the child object and play the animation via the Animation Window, it looks as expected and is in the right place.

    Now, I add an Animation Track in the Timeline on the parent, referring to this child object. I drag in the AnimationClip for the animation, the same one that's playing in the Animation Window. Now I hit play in the Timeline Window. And suddenly, the child object is in a completely different place, with a different rotation, from when I play the animation via the Animation Window.

    In the Animation Window, if I play the clip while the window is "linked" with the Timeline Window, it shows the wrong animation. If I unlink the windows, deselect the parent object, select the child, and play the animation there, it's correct again.

    There are no other objects being affected by the Timeline. I tried again with a second child object that's animated, with the exact same results - it is wrong in exactly the same way that the first object was wrong.

    Any advice on figuring out where the discrepancy comes from?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    841
    I suspect the animation you have is being played is writing a non-zero translation/rotation on it's first key. In Timeline, on the clip, try unchecking the RemoveStartOffset button. That's my guess at the cause of the discrepancy.
     
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,115
    OK, that looks about right now. Thanks!