[2D] move_and_collide doesn't work properly for me

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

Hello people,
I’ve got a really annoying problem: I’m trying to make some test for the character movement and I found out that even with move_and_collide if the kinematic body has a velocity of 28.990 or less (without delta) it will slide when colliding with a static body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
	var collision : KinematicCollision2D = null;
	var velocity : Vector2
	var speedDeltaOk = 1738.2 #stop sliding at this speed
	var speedOk = 28.97 #stop sliding at this speed
	var speed = 28.00
	velocity = Vector2(speed,0)
	collision = move_and_collide(velocity, true, false)

I cannot reproduce this. Works fine for me. Can you provide an example project?

njamster | 2020-03-19 15:13