Search Unity

How to use PlayableDirector.timeUpdateMode to reverse time?

Discussion in 'Timeline' started by GilbertoBitt, Jul 12, 2017.

  1. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    75
    I was reading about PlayableDirector.timeUpdateMode that is possible to use manual mode using the tick function so I want to know more about the tick function because on documentation we don't have much about. And use it to create a reverse mode to play timeline. Like creating a mode to reverse player.
     
  2. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    123
    When using the manual mode on the PlayableDirector, you can trigger an update by setting the director to the desired time (by setting the time property) and then by triggering an evalutation (director.Evaluate()).

    On each frame, you can calculate a new time with the help of the Time.deltaTime property. This will let you implement a reverse mode. You can also check this post, where I coded a playable that plays a timeline backwards.
     
    PandaDump and GilbertoBitt like this.
  3. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    75
  4. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    181
    What's the generic way to just play a timeline backwards if you don't want manual evaluations or to put code in Update() etc? Basically make it as clean as playing it forwards?
     
    Last edited: Jul 27, 2017