Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Tween Track Keep Position

Discussion in 'Timeline' started by Nerull22, Jun 6, 2023.

  1. Nerull22

    Nerull22

    Joined:
    Dec 31, 2010
    Posts:
    14
    Hi, I'm working on getting tween timeline tracks to keep their position after the track finishes. I'm using the Unity samples here: https://docs.unity3d.com/Packages/com.unity.timeline@1.6/manual/smpl_custom_tween.html

    Which in the notes states that it will return to it's original position when the track is over. Does anyone know how to change this behavior? I've been attempting to modify the position at the end of the clip with OnBehaviourPause, and GraphStop, and PlayableDestroy, etc. But I have had -NO- luck. Does anyone have any advice here? Any information will be greatly appreciate.
     
    Lukas-Labaj likes this.
  2. Lukas-Labaj

    Lukas-Labaj

    Joined:
    Nov 22, 2012
    Posts:
    36
  3. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    111
    The Default position (when there's no clips) is stored in
    TweenMixerBehaviour.m_InitialPosition
    . If you add code to update it, you could keep the position.