This behavior often happens because pausing the timeline stops its evaluation, and if the object has an Animator (or similar component) it can revert to its default state when not actively driven by the timeline. In other words, when you call Pause() on the PlayableDirector, the timeline stops updating the animated properties, and the object’s natural state (or the one driven by its Animator component) takes over.
Here are a few common workarounds:
• Use playbackSpeed = 0 Instead of Pause():
By setting the PlayableDirector’s playbackSpeed to 0, you keep the timeline “frozen” at the last evaluated frame without halting evaluation completely. This can prevent the object from snapping back.
• Adjust Animator Settings:
If your object is animated via an Animator, check its update mode and culling settings. For example, setting the Animator’s culling mode to “Always Animate” may help ensure that the timeline’s values persist even when playback is paused.
• Custom Scripting:
As an alternative, you could capture the object’s transform or animated properties at the moment you want to pause and reapply them manually when needed.
• Clip Extrapolation:
Make sure that your timeline clips are set to “Hold” at the end. This tells Unity to maintain the last keyframed value rather than reverting to a default state once the clip’s time range is exceeded.
In summary, the snapping occurs because pausing stops the timeline’s active evaluation, leaving the object to fall back to its default behavior. Adjusting how you pause (or modifying the Animator settings) can help maintain the state you want.