Search Unity

Looping animations in a looping timeline

Discussion in 'Timeline' started by NeilW, Sep 27, 2017.

  1. NeilW

    NeilW

    Joined:
    May 29, 2014
    Posts:
    40
    Hi,

    I am trying to to have two characters in a timeline each play their looping idle animation inside a looping timeline. However each characters idle is a different length so I get a pop when the timeline loops and the looping idles both start again from their first frame. Is there a way to have the looping animation continue from its current position when the timeline loops?

    One potential solution is to put the idle in the characters animation controller, rather than play it from the timeline, however with this approach there is no way to preview the idle animation without entering play mode.

    Thanks

    Neil.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    916
    Right, so the pop might be from any inherit root motion. You could make the timeline clips really long, but the better solution would probably be an animator controller.

    Timeline's root motion is computed based on the time relative to the clip, where as the animator controller apply a delta each frame, so looping will look more natural.
     
  3. NeilW

    NeilW

    Joined:
    May 29, 2014
    Posts:
    40
    I don't think the pop is related root motion (as the characters dont move) - its just that if I have one Idle that is 20 frames and one that is 30 then if I make the timeline 30 frames long when it loops the first idle will be on frame 10 then jump to 0. (I know in this trivial case I could use a length of 60 to have them loop in sync but in more complex examples this isn't always feasible). What I would Ideally like is that the first characters animation would continue from frame 10.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    916
    Ah, I see. I think controllers are the way to go, or a timeline per character, if that's feasible.