summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-09 15:12:08 +0100
committerGitHub <noreply@github.com>2022-03-09 15:12:08 +0100
commitbc9dd15f0e4408cbde1942a11aba8fc5eed71589 (patch)
tree2f346b78f0e5f775a93718018f33fcd699c3a9f5 /scene/3d
parent56d055c1f9a8aaf5930706f60737447081ebba31 (diff)
parent7f47889a5f70a29701a3571809fb4c1c7dae917a (diff)
Merge pull request #58926 from fabriceci/avoid-direction-correction-when-motion-is-down
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/physics_body_3d.cpp2
1 files changed, 1 insertions, 1 deletions
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();