Search Unity

How can I force my timeline to sync keyframes with the sound?

Discussion in 'Timeline' started by jeango, Nov 21, 2020.

  1. jeango

    jeango

    Joined:
    Dec 19, 2012
    Posts:
    109
    So I noticed some weird issues with synchronisation between sound and animations with my timeline animations.
    I've not tested this on a build, but in the editor, if there's a little bit of lag at some point while the timeline is playing, after the lag, the timeline will resume at the next keyframe. However, the audioclip meanwhile kept going, and this causes the animation not to be in sync with the sound anymore.

    Is there a way to force timeline to respect realtime, or at least to catch up in some way when it's behind?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    There have been fixes to some synchronizing issues in recent versions of Unity (2021, 2020, 2019.4) - if you are using older versions that might fix some issues. If you require the timeline and audio to maintain perfect synchronization, use a DSP Clock update mode on the playableDirector. The timeline will run off the audio clock instead of the game clock, which avoids any drift.