how to stop sliding on slopes(friction) in 3.1(KinematicBody2D)?

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

“slope_stop_min_velocity” for KinematicBody2D has been removed in 3.1 and it always keeps sliding. Could anybody think of a good way to reimplement some kind of slope friction?
There is the “stop_on_slope” option but it doesnt stop the body once its sliding but only prevents it from starting to slide if it has gravity.
I also tried snap and the RayShapeCollision on the feet but it didnt change the sliding behaviour in any way.

i have same question, would like to know the answer,while doing some research too

ruruarchy | 2019-09-10 06:51

:bust_in_silhouette: Reply From: Ogeeice

I use 3.1 and I still have a kinematicbody2d

:bust_in_silhouette: Reply From: Inces

I finally figured easy way to counter slopefall. Use additional CollisionShape Node with a shape of rectangle, that is larger than your original collisionshape, and locate it in the bottom of character. Angles of rectangle naturally prevent any slope movement, contradictory to capsule. Than simply implement a code to DISABLE square collision shape on movement inputs, and ENABLE it when no such input is pressed.