Sticking to the wall

image
Can you tell me how to make the player get into the wall and stick to it?

1 Like

Hi there is a lot of ways to do this, the easy way is to check if the player is in collision with the wall then forbid left/right and just allow up/down but you need to add a sprite to act as wall.

Other option is to add a custom movement behavior to your player and when he is in collision with the wall disable Platformer and enable Custom movement just to go up/down.

Another is if the player is in collision with wall make the X position of the player to the wall X position and control that with an object variable so if the user press up/down or jump let the player X to be different than wall x.

4 Likes

I did it something like this (it grabs the wall while falling and then starts to fall slower and also giving the chance to jump once)


But if you want the Object to move on the wall then maybe you can use forces (but as @UlisesFreitas said, disable the Platformer Behaviour at first).

2 Likes

im having similar issues as when my character hits the wall it decides to slowly go down compared if isn’t next/colliding with the walls

I believe there is wall jump behavior
And i think you can use it to stick to walls
If not you could use ladder object there to fake sticking to walls which would force you to have it on all walls

with me I do not have that ticked


to give some context In one level I use a spring to get to a higher point, the problem is that the spring is next to the wall and when I use it
Desktop 2025.03.11 - 11.02.14.01

In this one I am it using Physics2 (I have a couple of this game since I’m trying to test Physics2 and see whats better

You should not mix behaviors
IF you use for your player physics your walls should also use physics and not platform behavior

1 Like