Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Timeline and Animations

Discussion in '2018.3 Beta' started by davient, Nov 30, 2018.

  1. davient

    davient

    Joined:
    Dec 9, 2012
    Posts:
    2
    In Unity 2018.3.0b12, 2018.3.0b3 (others untested)

    When triggered in Timeline, Animations that modify a property on a GameObject (e.g., Transform.localposition), will have that property reset by a second Animation that does not modify that property (e.g., Transform.localscale).

    Is this intended behaviour? Perhaps I am misunderstanding how this should work?

    I attach an example project: With a Sphere that moves left 5 units and then scales up *5.

    With the timeline PlayOnAwake disabled: the Animator correctly animates through the steps.


    With the timeline PlayOnAwake enabled: The Timeline Fires each animation independently overriding the offset created by the first animation.
     

    Attached Files:

  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    The behaviour you are seeing is expected. On the second animation, the default position/rotation values are being written.

    Timeline works slightly differently that the animator controller in that regard. If you want to keep the offset, you need a position/rotation key, which will enable clip offsets and that let you match the offsets to the previous clip.
     
  3. davient

    davient

    Joined:
    Dec 9, 2012
    Posts:
    2
    Thanks for your response :)

    I've tried adding Position and/or Rotation Keyframes to the Animation Clip (I'm assuming this is what you mean?) but these don't fix the problem. My assumption is that putting in a position keyframe will fix the position to that spot? (so I don't see how that would help?)

    I've dug further and found that I can get the in game to play correctly by setting the Track Offsets on the Timeline->AnimationTrack to Apply Scene Offsets. However, when playing this in the Timeline in editor mode the animation plays incorrectly as I first described.
    Naturally this will make development within timeline cumbersome, as we will have to play the scene every time we want to check an edit.