Is there a way to cut an animation transition short and go to the next state?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By blurrred

I’m trying to implement proper jumping and landing
animations. I’m having issues with the xfade transition between jumping and falling persisting past when the player should be in the
next state, landing. I have increased the xfade time to make the issue clear to see. Please do not suggest removing the xfade altogether,
that will simply create the new problem of an abrupt transition between the jumping and falling states.

Here is a video showing my animation state machine:

I need the animation to progress to and past the ‘falling’ state immediately when I try traveling to the ‘idle’ state.

:bust_in_silhouette: Reply From: SnapCracklins

What does your implementation/code look like?
It may not be your animations but the state?

How does your code change from “falling” to “idle”?

Also, slightly unrelated but I have been working with state machines lately. It usually helps that anything that is some state different from the others become a separate state itself. If you have a transition, perhaps make it an additional “buffer” state to smooth things out. It could be a matter of states changing too quickly or “leaking” into other states because no logic is stopping it from doing so.

My code is pretty straightforward. I’ve tried both starting and traveling to the landing animation, neither work properly. I have also tried stoping the currently playing animation first, and that still does not work.

It appears that there is nothing I can do to cut the xfade time short. I may be wrong and would love to know a way to do it.

I found these two github issues which seem to be the same problem that I’m having. Perhaps we just need to wait for a fix to be implemented before this will work.
Animation Transitions are not interruptable · Issue #43570 · godotengine/godot · GitHub
Allow animation blends/transitions to be interrupted in StateMachine · Issue #2200 · godotengine/godot-proposals · GitHub

blurrred | 2022-05-19 21:50