Should I make a seperate state in my FSM for an in-between animation or include it in one of my existing states?

Godot Version

v4.stable.official

Question

Hello Godot Forum!

I’m learning how to use FSMs to handle player controls and animations. I understand the fundamentals of a FSM and have been able to implement it with success. However, I have a question about a conceptual problem I’m having.

Currently I have 2 working states: a “Jumping” state and a “Falling” state, each with its own animation. I have a third animation that is supposed to go in-between the other two, with the intent for it to play at the apex of the player’s jump, then transition into the falling animation.

My question is: should the “in-between” animation have its own state that goes between the jumping and falling states, or should it be included within one of the two existing states? My thought process is that the in-between wouldn’t have any unique functionality from the other two, and so I should avoid complicating the scene with another state. However making a new state seems like the simplest approach for implementing it.

What are all your thoughts?

Thanks in advance for any replies!

It sounds to me that the apex animation is part of the jump state. It is part of, say, a jump_completed function, assuming the jump might be interrupted by a wall or taking damage. Then once jump_completed is finished, you can change_state to falling.

Unless the jump_completed animation is used elsewhere, it is definitely part of the jumping state. If it is used elsewhere, it should be its own state.

Just my two pence worth,

Paul