diff --git a/client/scripts/player.gd b/client/scripts/player.gd index 4283bee..75599fe 100644 --- a/client/scripts/player.gd +++ b/client/scripts/player.gd @@ -570,10 +570,15 @@ func _physics_process(_delta: float) -> void: _snap_capsule_upright() return - var feet_y: float = capsule_feet_y(global_position.y, CAPSULE_HALF_HEIGHT) + # Use actual capsule bottom (total half = CAPSULE_HALF_HEIGHT + PLAYER_CAPSULE_RADIUS = 0.9 m) + # so the descend bypass only fires when the goal surface is genuinely below the player's + # physical feet. Using CAPSULE_HALF_HEIGHT alone (0.5) was ~0.4 m too high: from the first + # step (body 1.2 → code-feet 0.7) it incorrectly fired for the platform goal (Y=0.6 < 0.64), + # using FLOOR_SNAP_MOVING to pull the capsule back to the step after every assist lift. + var feet_y: float = capsule_feet_y(global_position.y, CAPSULE_HALF_HEIGHT + PLAYER_CAPSULE_RADIUS) if _auth_walk_goal.y < feet_y - DESCEND_GOAL_Y_MARGIN: _set_horizontal_velocity_toward(_auth_walk_goal) - floor_snap_length = FLOOR_SNAP_MOVING + floor_snap_length = WALK_STEP_ASSIST_SNAP if _step_assist_active else FLOOR_SNAP_MOVING move_and_slide() _after_walk_move_and_slide() if _step_assist_active and (