فهرست منبع

Merge pull request #58926 from fabriceci/avoid-direction-correction-when-motion-is-down

Rémi Verschelde 3 سال پیش
والد
کامیت
bc9dd15f0e
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      scene/3d/physics_body_3d.cpp

+ 1 - 1
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();