Reorder and update character controller checks in collision world

This commit is contained in:
2026-04-12 01:40:14 +02:00
parent d2eff2f3a8
commit e0e895add5

View File

@@ -465,17 +465,13 @@ export class RapierCollisionWorld {
);
const supportGrounded = supportProbe.grounded;
if (motion.y > COLLISION_EPSILON && snapToGroundWasEnabled) {
this.characterController.disableSnapToGround();
}
if (!supportGrounded && autostepWasEnabled) {
this.characterController.disableAutostep();
}
const computeResolvedMovement = (allowAutostep: boolean) => {
this.playerCollider.setTranslation(currentCenter);
if (motion.y > COLLISION_EPSILON && snapToGroundWasEnabled) {
this.characterController.disableSnapToGround();
}
if (autostepWasEnabled) {
if (allowAutostep) {
this.characterController.enableAutostep(