I’m going to show you how to made a simple state machine in GDevelop 5

First grab the assets here

So lets start

assets 1 - Games IgniterCreate a Scene and add all the assets, then create 4 text objects for debug purpose.

The Events of the GameScene

agamescene - Games Igniter

Create an Externa events and name it PlayerEvents and place this code

assets 2 - Games Igniter

Continue inside of the Player Group just below the Direction Group put these events

assets 5 - Games Igniter assets 6 - Games Igniter assets 7 - Games Igniter assets 3 - Games Igniter assets 4 - Games IgniterSo its done, I could figured out how to play idle animation when the player is in collision with a wall but is up to you to do it. And check the speed of the animations in this demo is set to 0.15 maybe is better to set a lower value so the animation plays fast.

Play it here

Demo:

Grab the source code from GitHub