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.
pull/41/head
VinPropane 2026-04-11 22:46:17 -04:00
parent 1944eeafe8
commit cb001a9369
1 changed files with 7 additions and 2 deletions

View File

@ -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 (