Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How To Play Timeline Use Time Round To Frame

Discussion in 'Timeline' started by newfolder_hugh, Aug 12, 2021.

  1. newfolder_hugh

    newfolder_hugh

    Joined:
    Sep 9, 2019
    Posts:
    1
    When I use PlayableDirector to play a 30FPS Timeline with "GameTime" update mode, it will appear some unwished blending animation.

    I tried use "Manual" update mode, and evaluate PlayableDirector in time round to frame. This solution can get correct animations, but the marks in timeline will not notify anymore.
     
  2. kartoonist435

    kartoonist435

    Joined:
    Feb 14, 2015
    Posts:
    73
    Did you ever figure this out? I'm having the same problem. Timeline evaluates the animation by lerping between values rather than just playing frames and that makes my technical animation get all glitchy
     
  3. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    126
    How about set the speed of the PlayableGraph every frame, so that it can run in a (faked) fixed framerate.
    Code (CSharp):
    1.         private void Update()
    2.         {
    3.                 var playableGraph = playableDirector.playableGraph;
    4.                 var root = playableGraph.GetRootPlayable(0);
    5.                 root.SetSpeed(1d / 60d / Time.deltaTime); // delta time to fixed 60fps
    6.         }