Search Unity

Jump to Frame

Discussion in 'Timeline' started by hiroaoki, Oct 18, 2017.

  1. hiroaoki

    hiroaoki

    Joined:
    Dec 12, 2015
    Posts:
    2
    Can I jump to any frame while I play the timeline?
     
  2. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    127
    Yes. You can set the time on the PlayableDirector component: Director.time
     
    hiroaoki likes this.
  3. hiroaoki

    hiroaoki

    Joined:
    Dec 12, 2015
    Posts:
    2
    Thanks, julienne !
     
  4. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    62
    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?
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    965
    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;