Search Unity

Accessing Playable Director from a track to get the current time

Discussion in 'Timeline' started by Carwashh, Nov 6, 2017.

  1. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    763
    How do I access the Playable Director from a track to get the current time?

    I'm trying to do this because if you use loop the playable.GetTime() in a mixerbehaviour returns an accumulated time of all loops played (eg: timeline is 3 seconds long, first loop returns 0-3 secs, seond loop returns 3.1-6secs, 4th loop 6.1-9secs...and so on). Looking at the playable director in the inspector shows the current time looping round from 0-3 for all loops, I need this time -> how?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    playable.GetGraph().GetResolver() as PlayableDirector will give you the playable director playing the timeline.