From 7e1fb6f8770ee41a2f5a66ee2c8b15e61ddac6a4 Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Sat, 4 Feb 2023 21:41:50 +0100 Subject: Fix snap to ground being triggered on exactly perpendicular movement --- src/control/character_controller.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs index b6d2dcc..7b60e82 100644 --- a/src/control/character_controller.rs +++ b/src/control/character_controller.rs @@ -324,7 +324,7 @@ impl KinematicCharacterController { result: &mut EffectiveCharacterMovement, ) -> Option<(ColliderHandle, TOI)> { if let Some(snap_distance) = self.snap_to_ground { - if result.translation.dot(&self.up) < 1.0e-5 { + if result.translation.dot(&self.up) < -1.0e-5 { let snap_distance = snap_distance.eval(dims.y); let offset = self.offset.eval(dims.y); if let Some((hit_handle, hit)) = queries.cast_shape( -- cgit