From c575d6d042890250c50399f94b4f92ccd9eca772 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 12 Apr 2026 01:47:09 +0200 Subject: [PATCH] Update player locomotion to consider immediate grounding --- src/runtime-three/player-locomotion.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runtime-three/player-locomotion.ts b/src/runtime-three/player-locomotion.ts index 86d249fa..3d5d17cc 100644 --- a/src/runtime-three/player-locomotion.ts +++ b/src/runtime-three/player-locomotion.ts @@ -405,8 +405,13 @@ export function stepPlayerLocomotion( // the controller back into grounded/stick-to-ground logic. const ascendingFromPreviousFrame = options.verticalVelocity > VERTICAL_ASCENT_EPSILON; + const canUseImmediateGrounding = + options.previousLocomotionState === undefined || + options.previousLocomotionState.grounded; const currentlyGrounded = - currentGroundProbe.grounded && !ascendingFromPreviousFrame; + currentGroundProbe.grounded && + !ascendingFromPreviousFrame && + canUseImmediateGrounding; if (currentlyGrounded) { coyoteTimeRemainingMs = options.movement.jump.coyoteTimeMs;