Search Unity

Animation Event playing out of place, when animation track restarts

Discussion in 'Animation' started by totsboy, Apr 4, 2019.

  1. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Hello
    I am having a problem with a looping animation. Every time the animation restarts, it triggers all animation events. This is what the dopesheet looks like:


    This animation is inside a timeline, not sure if it makes any difference.
    Any ideas what could be causing it?

    Thanks
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    When you call SetTime on a Playable, it jumps the time but also triggers any animation events between the previous and current time when it next evaluates. I work around this in my Animancer plugin by simply calling SetTime twice in a row, but I've never used Timeline so I'm not sure if it's possible for you to do the same.