From cb001a9369ccbb0a24b31633ca7c66481b396226 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sat, 11 Apr 2026 22:46:17 -0400 Subject: [PATCH] NEON-29: fix descend bypass using wrong feet_y, trapping player on first step capsule_feet_y was called with CAPSULE_HALF_HEIGHT (0.5, cylinder half only), giving a "code-feet" that is 0.4 m above the actual capsule bottom. From the first step (body Y=1.2): code-feet = 0.7, which is above the platform goal (Y=0.6). 0.6 < 0.64 triggered the descend bypass even though the player needed to ascend. Each bypass tick used FLOOR_SNAP_MOVING=0.32 m, which snapped the capsule back to the step surface (0.11 m below the assist-lifted bottom), undoing every step assist lift in an oscillation loop. The player appeared to float at first-step height and could not reach the second platform. Fix: use CAPSULE_HALF_HEIGHT + PLAYER_CAPSULE_RADIUS (=0.9, the actual capsule bottom) for the feet_y in the descend bypass condition. The bypass now fires only when the goal surface is genuinely below the player's physical feet, not when the player needs to ascend through stepped geometry. Also use WALK_STEP_ASSIST_SNAP instead of FLOOR_SNAP_MOVING in the descend bypass when _step_assist_active is true, so any remaining overlap cannot undo a step assist lift via the large snap. --- client/scripts/player.gd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 (