move_and_slide's slope_stop_min_velocity is stopping player when on flat ground

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

If I’m at a dead stop on flat ground, if slope_stop_min_velocity is set reasonably high, then my character can barely move (if at all). Lowering slope_stop_min_velocity lets me move across the flat surface as expected, but then I slip too easily on actual slopes. If I jump, move horizontally, and land while maintaining horizontal movement, I can keep going, but the second I switch directions or stop, I’ll get stuck again.

Players got a KinematicBody2D with a capsuleShape.
Floor is a StaticBody2D with rectangleShape.

Why does move_and_slide seem to treat flat ground like a slope?

const SLOPE_SLIDE_STOP = 25
var floorNormal = Vector2(0,-1)
var maxSpeed=128

velocity += delta*gravity
velocity = move_and_slide(velocity, floorNormal, SLOPE_SLIDE_STOP)


-calculate horizontal movement

velocity.x += delta * xMove

I’m pretty sure you should put move and slide after manipulating the velocity variable.

SIsilicon | 2018-10-16 13:24

The code I posted mirrors the structure of the 2D platformer example project. The only effect this should currently have is to apply your input-responsive movement on the following physics frame. I had tried what you suggested, and saw no change.

Grumpkin | 2018-10-29 23:17