Sliding movement in a 2D platformer

4.1

I’m working on a 2D platformer, and I want the character to have easily adjustable sliding movement (like Luigi in a Mario game), but I have no idea how to do it.

1 Like

first you need a player character with momentum (also called ‘smooth movement’)
then you can set the deceleration higher to make them slip like Luigi

2 Likes

I’m using a character body, does it have momentum pre programmed, or do I have to add it?

1 Like

the purpose of the CharacterBody nodes is that you can script any kind of movement you want while worrying much less about detecting collisions.

because of the “you can script any kind of movement” you have to add momentum (acceleration and deceleration) in the script.

because there are so many slightly different ways you could want your character to move, you have to experiment with movement yourself, even while learning from tutorials.

1 Like

this tutorial had a pretty simple way of doing it and now I’ve got it working

1 Like

it actually kind of suck cause we cannot use delta time on it so the player will move faster depending on your fps