Search Unity

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,516
    You can set the time of a timeline using PlayableDirector.time and evaluate it manually using PlayableDirector.Evaluate().