![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Blue Velvet Cake |
Hi, I’m trying to throw together a first person character controller with a KinematicBody and I’m having trouble keeping it from sliding down slopes.
At the moment, I am using a setup like self.velocity = self.move_and_slide(velocity)
, and as expected the character slowly slides down any slope its put on when gravity. However, the sliding persists even when I have the stop_on_slope
parameter set, and the character is on a slope that’s shallow enough to be considered a floor.
Correct me if I’m wrong, but I assume this is due to the fact that the function is still returning the collision’s resultant velocity, which would push the character sideways a small bit due to gravity pushing the character into the slope.
How would I go about preventing move_and_slide
from pushing the character sideways when gravity is effecting them on a shallow slope? Would it be easier to use move_and_slide_with_snap
instead?