From 7f47889a5f70a29701a3571809fb4c1c7dae917a Mon Sep 17 00:00:00 2001 From: fabriceci Date: Wed, 9 Mar 2022 13:45:42 +0100 Subject: Avoid directional correction when the motion is downward --- scene/3d/physics_body_3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index c1f5ab1d32..47baa9e023 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1425,7 +1425,7 @@ void CharacterBody3D::_move_and_slide_grounded(double p_delta, bool p_was_on_flo const PhysicsServer3D::MotionCollision &collision = result.collisions[0]; Vector3 slide_motion = result.remainder.slide(collision.normal); - if (collision_state.floor && !collision_state.wall) { + if (collision_state.floor && !collision_state.wall && !motion_slide_up.is_equal_approx(Vector3())) { // Slide using the intersection between the motion plane and the floor plane, // in order to keep the direction intact. real_t motion_length = slide_motion.length(); -- cgit v1.2.3