Jump to Frame

Can I jump to any frame while I play the timeline?

Yes. You can set the time on the PlayableDirector component: Director.time

2 Likes

Thanks, julienne !

Sorry to bump this, why there’s no “frame” property exposed apart from time? if in the timelline editor window we see only frames displayed?

The engine has no real concept of ‘frames’, at least in the timeline sense. The frames in the timeline editor is simply for authoring purposes, but during playback, the timeline is most often evaluated between frames. Because timeline is updated after Update() in the player loop, the delta time can vary, just like any other script.

However, you can do a frame->time conversion yourself with
director.time = frame / ((TimelineAsset) director.playableAsset).editorSettings.fps;

2 Likes
  private void setTime()
    {
       playableDirector = myPlayableDirectorGO.GetComponent<PlayableDirector>();
        Debug.Log(timeLinePosition);
        playableDirector.time = timeLinePosition / ((TimelineAsset)playableDirector.playableAsset).editorSettings.fps;
        playableDirector.RebuildGraph();
        playableDirector.Play();
        //playableDirector.playableGraph.GetRootPlayable(0).SetSpeed(0);
    }