From 6c3bfb3bf826b296320803dc8946c7af0df20372 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 29 Apr 2024 05:50:49 +0200 Subject: [PATCH] Use slide instead of bounce for collisions --- extensions/better_character_body_2d.gd | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/better_character_body_2d.gd b/extensions/better_character_body_2d.gd index d397544..7c0552f 100644 --- a/extensions/better_character_body_2d.gd +++ b/extensions/better_character_body_2d.gd @@ -29,7 +29,5 @@ func better_move_and_collide(movement: Vector2): collided_once.emit(collision) # Determine the normal of the collision (the direction the body should be pushed back in) var collision_normal = collision.get_normal() - # Change the velocity adequately - velocity = velocity.bounce(collision_normal) # Reflect the remaining movement - movement = collision.get_remainder().bounce(collision_normal) + movement = collision.get_remainder().slide(collision_normal)