Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Tips and tricks for using PlayableDirector in Manual update mode

Discussion in 'Timeline' started by doctorpangloss, Aug 4, 2019.

  1. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    241
    The documentation on this is pretty sparse and infuriating so I'm including the completely undocumented things you need to do to actually control a PlayableDirector manually.

    The main thing you're probably missing is that you always call
    Code (CSharp):
    1. playableDirector.DeferredEvaluate()
    once per frame.

    • Set your Update Mode to Manual.
    • In an Update function, call
      Code (CSharp):
      1. playableDirector.DeferredEvaluate();
    • If you want to advance the whole director, use
      Code (CSharp):
      1. playableDirector.time += yourDeltaTime
      .
    • If you want to use the PlayableGraph object, for whatever reason, you must rebuild the graph at least once (try doing it in Start / Awake) or whenever your playable asset changes:
      Code (CSharp):
      1. playableDirector.RebuildGraph();
      2. playableDirector.playableGraph.SetTimeUpdateMode(DirectorUpdateMode.Manual);
     
    BobMCleod and seant_unity like this.
unityunity