Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Reverse the Timeline animation

Discussion in 'Timeline' started by flar323, May 6, 2019.

  1. flar323

    flar323

    Joined:
    Jun 24, 2015
    Posts:
    1
    Hi,
    I'm new to unity timeline ,i just wanna play the timeline animation in reverse. I have a simple character forward walking animation i want the animation to play in reverse,when in press backward key.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    That isn't built-in to timeline or the playable director, mainly because not all tracks can support it - like audio.

    You can acoomplish it via script by setting the playableDirector playmode to Manual, setting the time (time -= Time.deltaTime, for example) and calling DeferredEvaluate(), but in this mode Markers and Audio won't play.
     
  3. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,181
    It would be very handy if just the AnimationPlayableAsset (the clip) is reversible by a boolean check box on the clip! My main use is for those UI and transition animations where I want to have it close the same way it open but in reversed direction (and probably a bit faster/slower, and time stretching is already possible with this type of clip asset). This way when I update the open animation, the close animation could be updated together. I think this wouldn't be so destructive to the whole time continuity guarantee of the playable system like if we make everything reversible.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    Agreed, good suggestion @5argon, and not the first time this has been asked. I believe it is on our feature backlog. Animation Clip playback has been optimized to play forward, and so playing a clip backwards by reversing time flow is not an efficient way to play the clip. This is what happens with PingPong extrapolation currently. But having a clip that is known to play backwards would allow optimal playback as well.
     
    5argon likes this.