#Multiple transitions between animations

1 messages · Page 1 of 1 (latest)

lyric galleon
#

The API for play_with_transition works well for transitioning between two single animations. However, if a third animation is played (i.e. walk -> run -> walk) when the player repeatedly taps a button there is a sharp transition and it seems to override the first transition.

Is this expected, and if so, is there a recommended way to handle this?

nocturne quarry
# lyric galleon The API for `play_with_transition` works well for transitioning between two sing...

I'm having same issue, but a quick look at the source code makes it seem like it should work:

// Add the current transition. If other transitions are still ongoing,
// this will keep those transitions running and cause a transition between
// the output of that previous transition to the new animation.
self.transitions.push(AnimationTransition {
    current_weight: 1.0,
    weight_decline_per_sec: 1.0 / transition_duration.as_secs_f32(),
    animation,
});
#

Going by the comment and the fact that transitions is a collection it looks like the blending should carry over mid-transition, but in my game it looks really sharp if I go from walk -> idle -> walk

lyric galleon
#

🤔 Yea I had the same thought reading the code. Let me know if you have any insights.

nocturne quarry
# lyric galleon 🤔 Yea I had the same thought reading the code. Let me know if you have any insi...

I don't 😦 I think at some point I might revisit it and get to the bottom of it if no one has found the issue, but for the time being, I just worked around it. In my case what I did was keep the player in the walk animation unless both the character velocity and player input are below a threshold. Before I was just blending between walk -> idle whenever the grounded velocity went under a certain value, which made it look super jittery when changing directions since it'll hit 0 at a certain point when going in the other direction.