I need a state machine and having Problems when my game is being tested the animations won't go past 2

Hello I’m sorta still new to Gdevlop 5 but I know the basics I have watched several tutorials. well anyways I wish to receive help on my game I need a advanced code with a state machine I need to be able to have several Idles and go from a walk to a jog to a run to a sprint I can’t seem to figure it out and when I try to do it myself most of my animations play when I view them in the objects editor but when i test my game in Gdevlop 5 the animations don’t show up. I am just wondering if there is a limit to how many animations you can have in one object and if so is there a work around please help me figure this out and please get back to me if you can help


For your questions:

  • Is there a limit on how many animations you can have in one object?
    • Nope! I currently have about 20+ animations on one character in the main game, but there’s no theoretical limit on animations.
  • Is there a workaround to your animations not playing? Yes, very likely .The biggest issue is likely going to your events having conflicts or missing criteria (such as not using “trigger once” when changing animations), or both.

Unfortunately, in general people on the forums won’t build out your events for you. I would recommend a few things:

  1. Review the Finite State Machine tutorial here: How to handle complex logic – The finite state machine (FSM) [GDevelop wiki]
  2. Go through the entire tutorial step by step.
  3. Once you’ve completed the tutorial, try adding another state from what you learned.
  4. As long as you can complete that, you should be able to rebuild your events to have the type of state machine you need.

You can also find an example here: [State machine] with 3 attacks, 3 air attacks, dash, wall jump

Also, more details about the concept behind state machines here: Working with Game States and Finite State Machine

I hope this helps!


I wanted to say something similar, just not in such a polite form. :rofl::stuck_out_tongue_winking_eye:

just to let you jerks who want to be rude I was not implying that i wanted it all done for me? firstly I just wanted advice i have autism so my social skills aren’t very good and it’s a cognitive issue that all people with autism suffer with so quit being rude and if I hear any more people on here being such I will be forced to find help elsewhere so please be considerate Thanxs

Hello! As a heads up, your title and first few lines (“I need a state machine” in the title and “I need advanced code with a state machine”) implies you’re wanting pre-made code.

I know that people with different placement on the spectrum of autism can sometimes have trouble with communicating context, so I wanted to make note that those lines specifically came off that way.

I wasn’t 100% sure if that’s what you meant, which is why I specifically mentioned that the forum users wouldn’t be able to provide code for you, but went ahead and provided you resources that you could still use to potentially find solutions.

I hope this helps you better understand my post, as well as helps you find the resources you need

Separately, please review the rules for the forum here: FAQ - GDevelop Forum

Any and all name-calling is against forum rules, and can result in a permanent ban. This includes “jerks”.