How to keep object state after timeline completes?

I'm using Timeline/Cinemachine to animate cameras and objects in a small cutscene. When the scene is complete (e.g. the Timeline has reached its end point), all of the objects have their values reset to their state before the Timeline was played.

I would like the objects to maintain their new values after the Timeline completes. Is there a way to do this?


I found if you set the Wrap Mode on the Playable Director component to "Hold" it seems to preserve the changes that the timeline makes after it finishes.

1 Like

It varies depending on the track you are using.
- Activation tracks have an option on the track for what state the object should be in when the timeline ends.
- Animation tracks leave their objects in their current state, but it may appear the values are being reset if you have a animator controller attached. The control of the object passes back from timeline to the controller.

The 'Hold' option does work as well, but be aware that it does that by keeping the timeline running, so you won't be able to change any values it is 'holding'.

Ah, that's helpful thanks. I didn't realise you could have a playable director without an animator controller though! I will try that as I will want to change the values / states at some point.

Ok, so I just tested that, and maybe I was being a bit stupid, but you have to have an enabled Animator on your object if you want to use an animation track in the timeline. Or is there another way to use animation tracks without an Animator component?

Animation tracks require an enabled Animator component. The animator is what applies the result of the animation track to the game object.

Ah ok. Seems like I need to look at a custom script to save transforms etc after the timeline animation has finished. Thanks.

You shouldn't have to - the timeline should leave it alone if there is no animator controller. If there is, the controller should pick up where you left off, if you are using root motion.

My particular set up I have a single animation I want to play on a static object, like a door opening. So I want the timeline to play that animation and leave the object in the state of the last frame of the animation. I'm only using the animator controller because the timeline requires one, not because I have any complex animations or animation graph. So the animator controller is resetting the transform, but I can't remove it because otherwise the timeline can't play the animation at all. Or am I missing something?

Just to clarify @joebain : the Animator is the component, while the AnimatorController is the controller assigned to that component. Timeline only requires the Animator, not the Controller:


Note that this makes animating objects way harder, because now "of course" the Animation window won't show your clips (as no Animator Controller is assigned with any clips). So you'll have to re-assign the Controller, animate, then remove the Controller again...


Any chance you guys can build in a way to flag a controller as "timeline only" (or something more generic), so we dont have to bounce them in and out like above?

1 Like

I am also running into the same issue. I want to use Timeline to perform a cutscene, and I want to persist the last state of that cutscene (it current just snaps back). It would be nice to add an option into Timeline that allow users to persist the states.