We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e929bb commit ea19166Copy full SHA for ea19166
src/control/character_controller.rs
@@ -195,6 +195,7 @@ impl KinematicCharacterController {
195
self.check_and_fix_penetrations();
196
197
let mut translation_remaining = desired_translation;
198
+ let mut translation_before = result.translation;
199
200
// Check if we are grounded at the initial position.
201
let grounded_at_starting_pos = self.detect_grounded_status_and_apply_friction(
@@ -290,6 +291,11 @@ impl KinematicCharacterController {
290
291
Some(&mut translation_remaining),
292
);
293
294
+ if (translation_before - result.translation).norm_squared() < 1e-10 {
295
+ break;
296
+ }
297
+ translation_before = result.translation;
298
+
299
if !self.slide {
300
break;
301
}
0 commit comments