Landing Animation doesn't work


So my character is Falling and on ground he will switch to idle. (works!)

Now i want that after some Fall time, that he makes like a roll on the ground.
So he shall switch from FALL to LANDING. (State Machine)
But whatever i do, if he hits the Ground he goes to idel.

Thanks for your help guys!

Are you trying to add a delay? In that case don’t use a timer, use the new Wait x seconds action! All it does it wait a certain amount of time (like 0.5 seconds) and then lets the following actions execute.

No, it should detect the Floor, best would be like 0.5s bevor it hits the floor it changes the animation.
But i tried with a collision mesh under the character and a distant between to points, sadly diden`t work for me.

You are telling it to hide/show every frame, change to animation 3 every frame, and restart the timer every frame.

I think you intended this to have a “At the beginning of scene” condition and forgot to add it, but even if not, this event will break most of your other events.

1 Like

Hi, just a few days ago there was a similar problem about adding screenshake after falling from higher buildings. A possible solution was to take the ‘current falling speed’ and use a boolean variable if the speed got over a particular value. Camera Shake from higher falls

Your timer-approach looks interesting but aside from what Sillver-Streak mentioned, at the moment you don’t measure any falltime with your timer. For that you need to start the timer in connection with the ‘is falling’-condition.

1 Like

Hey guys, thanks for the great Tipps! It works now.
I have taken the Timer out and set a Collision mesh to the character, that detects the floor.
And then i have added the Fallspeed too.

And i lookt over my code and i have still much to fix now…

How can i make it SOLVED?

Okay, what is happening now and what do you want to happen?

There are a few things that I think could be problematic:

The falling speed conditions probably won’t work because they are in conflict with the collision (as soon as the player lands there is no speed anymore). If you check the camera shake example again you will see that there is a boolean variable that toggles when the falling speed is above a particular value. Based on the state of this variable (True) the next event is triggered (in your case this would change the ALLOWLANDING variable to YES).

Your first event looks a little strange. It seems you have two different sprite-objects that represent the player. What you actually could do is to have all animations under one player-sprite object. In this case you don’t need to switch between hiding and showing different sprites.

Is there a specific reason that your STATE variables are all global?

1 Like

Hey Drona

So the 2 Sprite Players is because i renderd different Sizes of my Animation (I just started), what really caused allot of Troubles later. I will fix that today.

I Put the Global Variables there, because i thought my Player Controls need to be in the all game levels, was that wrong?

If it switches from FALL to LANDING, in LANDING i have a reset for ALLOWLANDING:0
And before JUMP there is RUN, that resets ALLOWLANDING too.
Now that i write this i see its quiet messy… :laughing:

But it works, i made a video, how can i upload that?

Cheers Chris

I guess it is not necessarily wrong but rather bad practice (?) because it could lead to several problems when your project increases. To avoid making the same events for every scene, there is the nice option to make external events Link events - GDevelop documentation and link them to the scene.

If you take a look at Silver-Streak’s ‘Not a vania’ example you can see how states can be managed, which variables are global etc. Not a vania - a game example from the GDevelop game making app | GDevelop

I have no idea. You could upload it somewhere and provide the link but if it works it is probably okay to keep it as it is.