Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. 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:
    71
    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:
    100
    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.         }