RigidBody2D stucks in air when colliding walls, how to fix it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By overflow
:warning: Old Version Published before Godot 3 was released.

Hello everyone.

I’ve got a box, that is RigidBody2D and controlled by player. It stucks in air when colliding a wall AND player moving on that wall. Expected result should be just sliding down. I tried to fix it with raycasts, but it seems to be hardcoding, because I’m using RigidBody2D node. Is there any ways to solve this more friendly and leave player as RigidBody2D to use physics?

Thanks.


enter image description here

func move(speed, delta):
if speed > 0 and curr_speed < 0:
	curr_speed = 0

if speed < 0 and curr_speed > 0:
	curr_speed = 0

curr_speed = lerp(curr_speed, speed, MOVE_ACCEL * delta)

set_axis_velocity(Vector2(curr_speed, 0))
:bust_in_silhouette: Reply From: SupToasty

Set the walls friction to 0.