How do i stop my character from sliding to the ground when on a slope

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hexadotz

Many people are having this problem and so am i so i created a fps control following the tutorial in : https://docs.godotengine.org/en/stable/tutorials/3d/fps_tutorial/part_one.html
One thing they forgot to add is preventing your character from sliding when on a slope
Also when i stop in the middle of the slope my character slightly jumps

:bust_in_silhouette: Reply From: spaceyjase

A couple of things to consider; move_and_slide is working correctly but should be told to stop_on_slope = true. This tutorial, however, uses a MAX_SLOPE_ANGLE to tell the physics what should still be considered a slope. You can change this value for your game; perhaps sliding is a good thing?

For the later, move_and_slide_with_snap will give you the desired result but again, requires tweaking for your specific game:

https://docs.godotengine.org/en/stable/classes/class_kinematicbody.html#class-kinematicbody-method-move-and-slide-with-snap