[SOLVED]Make character idle when stopped against a wall

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I…

How do I make my platformer character change its animation to idle when it was stopped by a wall

What is the expected result

I expect the platformer character to change it’s animation to idle, instead of still remaining at its walk/sprint/slide animation.

What is the actual result

Well, that platformer character kind of “glitching” from its idle to its current movement animation continuosly.

Related screenshots

I have a video recording of it but can’t upload :(.


Project files (optional)

Insert a minimal game showing your issue in a .zip or .rar.

Cannot see your collision event.

I haven’t add any collision events. But do anyone know how to fix the issue?

perhaps if you add a player is moving condition for the animation change? that is what i do.

But put at where, i tried arrangign it at different places but it still does not work.

You can add this for each condition except for the “change to idle”.

But you need to have 2 sprites. 1 for the platform and another for the “wall”

1 Like

I would put it wherever it says to activate to walking animation. This way you don’t need separate sprites but still get it to work, if it doesn’t work, send a screenshot of your events with the edits


Still does not work

Hmm, I don’t know then.

It makes no sense you toggle the Sprint Variable to true, since you have no condition saying what to do when it’s true.

Oh, i re edit the code again to make the “sliding” code more readable and made it so when it is only activatable when the “Sprint” variable is true

Geez, this method works! Although it costs me some time to get some code for the other sprite. Thank you so much to those who helped me :).

2 Likes