Help with Finite Machine Animation

Hey, so i set up a fsm the idle, run, jump and fall work and the text shows up in the debug info but when i try to play the animation for my ability (FrostBite) which can be triggered by just pressing"Y" on joystick it doesnt play, i know it triggered since i also will make the gamepad and screen vibrate but the animation wont play and it doesnt switch to that state (FrostBite) either

Can you provide a screen shot of the events that set the various animations?

Also, if you set animations using names, check that the names are correct, keeping in mind that GDevelop is case sensitive.

Why do you set the FSM states, but not use them when setting the animations?

Anyway, do you set the object variable Attack of Aurora anywhere? If not, I think the issue is that the conditions of the first and last events of your recent screen shot can both be true, and the last event’s animation change will override the animation change of the first event.

In that last event on the screen shot, you have an OR subcondition, and part of it reads “animation is not 8” or “animation is not 3” or “animation is not frostbite”. At least one of these is correct, so the animation will be set to idle. Did you mean for this to be an AND subcondition instead?

Also the Trigger once is part of the OR subcondition. You should move it out of there

Otherwise you need to rethink the logic. One really good way to do this is to make a flow diagram (with pencil and paper is easiest), with decision boxes and actions from those decision results. Once you have that sorted, it’ll make setting up the events a lot simpler

2 Likes

Following what @MrMen said, i’ve done a flow diagram for my game and it looks like this

And then I decided to polish it a little bit so it now looks like this

as @MrMen said, ideally your animations should be inside the States, the whole point of aplying the FSM method is to keep things sepparated, so you can troublesoot faster by knowing what is failing where and when, idk if this help, but I hope it does :slight_smile:

2 Likes