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

Controlling timeline playhead via script

Discussion in 'Timeline' started by Marcelpace, Jun 26, 2020.

  1. Marcelpace

    Marcelpace

    Joined:
    Oct 8, 2018
    Posts:
    1
    Hello.

    Is it possible to control the playhead of the Timeline through code?

    I am programming an auto-scrolling platform game and I want to use Unity's Timeline.
    The camera moves in a constant speed and I want to associate it with the Timeline's playhead, so the playhead moves in sync with the camera.

    Is it possible? How?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    You can set the time of a timeline using PlayableDirector.time and evaluate it manually using PlayableDirector.Evaluate().
     
unityunity