Wall sliding and jump


(noobIndie) #1

Hello everyone, I am trying to implement wall sliding and wall jumping, was wondering whats the logic behind it?

for sliding: IF the player is in AIR then check if there is wall 1 pixel to left or right,set isSliding var to true and apply sliding gravity else apply normal gravity

for wall jump if player IS SLIDING, then perform the wall jump

is it fine? thanks :smiley:


(Jacob Albano) #2

Have you tried it out yourself yet? If not, why not test it before asking for help?


(Zachary Lewis) #3

I think it feels better to only wall slide if the player is next to a wall and pressing toward it. If they are next to a wall and aren’t pressing anything, they should just fall normally.


(Willard Torres) #4

There’s only one way to find out if its fine-- implementation.

I also recommend using velocity and acceleration in your player to control the x and y position, as in this case it can be useful to know how fast the player is going (along with direction, etc.)


(Ethan) #5

Also consider making the wall slide position sticky. What I mean by this is that pressing in the direction opposite of the wall will not imediately take you out of a wall slide. This is because when performing a wall jump, most players will hit the movement button in the opposite direction of the wall before jumping.

It’s very much a feel thing.


(noobIndie) #6

yup I’ve done that too :smiley: (gave a delay of .2ms) , though what @zachwlewis said, i am a bit confused about that. I used super meatboy as a reference and in that, if you are close to wall and press jump, meatboy slides, but yea that can be changed