Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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:
    765
    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.