Search Unity

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:
    1,516
    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.
     
    andrew_ES likes this.
  3. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,542
    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.
     
    amesa_unity and Rib like this.
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
    Rib and 5argon like this.
  5. GeorgeAdamon

    GeorgeAdamon

    Joined:
    May 31, 2017
    Posts:
    42
    Vaupell likes this.
  6. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No, unfortunately nothing has changed on this. The best way to currently do this is to reverse the animation clip itself -- discussed here, with a sample script to convert the animation clip itself.
     
  7. Vivraan

    Vivraan

    Joined:
    Feb 2, 2018
    Posts:
    22
    Again, this a feature built right into Godot.
     
  8. Vivraan

    Vivraan

    Joined:
    Feb 2, 2018
    Posts:
    22
    The link points to an excellent script but unfortunately it uses an obsolete function. What would be the way around using
    AnimationClipCurveData
    ?
     
  9. babels

    babels

    Joined:
    Feb 1, 2020
    Posts:
    2
    yeah... no, the best way to do this is in the animator of a actual 3d program like blender or 3ds max. the process involves dragging and clicking on the desired keys as well as copy n paste. Yes it will make your file larger. Yes it is worth tradeoff for speed at runtime... even on mobile. How can so many coders not understand what a gui is
     
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,372
    And 2 years later?
     
    Vaupell likes this.
  11. GregMadison

    GregMadison

    Joined:
    Aug 2, 2015
    Posts:
    1
    Same as 5argon . Need that so much for UI animations :(
     
    Vaupell likes this.
  12. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    250
    Ha, was searching on this today, and ended up here finding out it's not supported..
     
  13. Cover-Club-Media

    Cover-Club-Media

    Joined:
    Apr 30, 2015
    Posts:
    97
    Would love to see this supported! But can work around it :(
     
  14. Eric-Farraro

    Eric-Farraro

    Joined:
    Apr 23, 2013
    Posts:
    31
    Suprised this isn't supported. It'd be very useful for UI animations (such as when a UI appears / disappears)
     
unityunity