Attack state machine

Godot Version

godot 4.2

Question

hey, i’m looking for a way to get things working properly for my state machines.
I have 4 states ground, air, landing and a attack state that have a combo of 2 attacks.
They’re all linked with a sprite2d, an animation player and an animation tree
the problem is that i want that my player can attack even if he’s in air. for now it’s working but when it change state, it stop the animation with some problems like the collision shape of my sword stay active if it was while i touch the ground.
i saw a video with a bear and a chewing bubble gum but the way that he use state machine is not the same as me so i cant really use it.
if you want an idea of what my states machine looks like, here’s the video i used to set it up : (https://www.youtube.com/watch?v=fuGiJdMrCAk)
thanks !

I think you just need more states. Create an air attack state that activates if the character in in the air while attacking. Alternatively you could separate upper and lower body animations and states but that can get very complex especially if you are still learning how state machines work.

Maybe the second option is the solution, I have another problem that I thought I would fix later but it could be fixed too with upper and lower body control. (My attack animation while moving made my character « slide » because the animation I use is made to attack while being static)
Is it with skeleton 2D that we control upper and lower body separately?