Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help Wanted With WrapMode set to None, animated objects reverting to previous state at end

Discussion in 'Timeline' started by Romano, Jun 12, 2020.

  1. Romano

    Romano

    Joined:
    Nov 27, 2013
    Posts:
    70
    Hiya. With the PlayableDirector's WrapMode set to None, the animated objects in my timeline are returning to their previous states after it's finished playing. Should this be happening? From what I've read, animated objects should maintain their states afterwards. I'm quite new to timelines so hoping I'm just doing something daft, but I can't see what's going wrong. One of the objects in question has no script attached that could change the state via code. The only controlling component it has attached is an animator with animator controller. All the positions that are set via the timeline (not via the objects' own animators with animator controllers) are staying where they should be when the timeline ends - in the last place the timeline left them

    Help appreciated, thanks!
     
    Last edited: Jun 12, 2020
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    Timeline does leave animated objects where they are, but if there is an animator controller attached, then it will continue to update the object when timeline is complete.

    In fact, they are both always running, timelines values just take precedence while it is running. The behaviour can also depend on 'WriteDefaults' in the animator controller state, and what exactly is being animated (Root motion of the object is a special case).
     
  3. Romano

    Romano

    Joined:
    Nov 27, 2013
    Posts:
    70
    Thanks! What's the recommended way of having continuity between a cutscene using timeline that goes back into gameplay? The animators return to their previous states and the cinemachine cameras do the same. How would I get them to keep the last state/clip the timeline assigns them?
    Edit: Or at least make it seem continuous?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    The simple answer is put at an ease-out on the last clips of the timeline so they blend back to scene values as the timeline ends. That will smoothly transition to the desired game state of the cinemachine camera and animator controllers.

    But, it all depends on context and how / what you are animating.
     
  5. Romano

    Romano

    Joined:
    Nov 27, 2013
    Posts:
    70
    That's great to know, I didn't think blending back to scene values was possible. I was wondering if an animator was playing a certain animation in the timeline, would I have to trigger the same animation on the animator controller before the timeline ends for it to seem continuous - from my brief tests it seems like its enough to trigger it in the same frame the timeline ends. I'd imagine easing back into scene values would require triggering the animation before the timeline ends. I just read this back and realised there's no question in there, so I think I understand it now - Thanks for all your help!
     
unityunity