From f70dbe8f881cace8860963b2b6f4eca7000e9546 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sat, 11 Apr 2026 23:55:03 -0400 Subject: [PATCH] =?UTF-8?q?NEON-29:=20Descend=20lip=20peel=20when=20on=5Ff?= =?UTF-8?q?loor=20+=20wallish=20(first=20step=20=E2=86=92=20floor)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First terrace step to main floor could stall: is_on_floor stayed true on the step top while a vertical face zeroed horizontal motion; vy was reset to 0 so no gravity ran. Taller drops broke contact sooner so second→floor worked. While descending (goal below feet) and on floor, if is_on_wall or any slide normal is wall-ish (ny < 0.55), integrate gravity into vy before move_and_slide. --- client/scripts/player.gd | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/client/scripts/player.gd b/client/scripts/player.gd index e69497a..0cacc9b 100644 --- a/client/scripts/player.gd +++ b/client/scripts/player.gd @@ -250,9 +250,28 @@ func _set_horizontal_velocity_toward(point: Vector3, fallback_dir_xz: Vector3 = ## While walking, integrate gravity when airborne so Jolt can register floor contacts and ## `move_and_slide` is not stuck with vy=0 above the surface (expanded district / terraces). func _apply_walk_air_gravity(delta: float) -> void: - if is_on_floor(): + var g_step: Vector3 = get_gravity() * delta + if not is_on_floor(): + velocity += g_step return - velocity += get_gravity() * delta + # Descending toward a lower surface (e.g. first terrace step → main floor): rim / internal + # edge contact can keep `is_on_floor()` true on the upper surface while the step's vertical + # face zeros horizontal motion. With vy forced to 0 by `_set_horizontal_velocity_toward`, + # no gravity ran and the capsule could hang until a new click retargeted. Shallow 0.3 m + # drops hit this more often than taller platform→floor descents. + var feet_on_floor: float = capsule_feet_y(global_position.y, CAPSULE_HALF_HEIGHT + PLAYER_CAPSULE_RADIUS) + var descending: bool = ( + _has_walk_goal and _auth_walk_goal.y < feet_on_floor - DESCEND_GOAL_Y_MARGIN + ) + if descending and g_step.y < 0.0: + var wallish: bool = is_on_wall() + if not wallish: + for i: int in get_slide_collision_count(): + if get_slide_collision(i).get_normal().y < 0.55: + wallish = true + break + if wallish: + velocity.y += g_step.y ## When the authoritative goal shares XZ with the capsule (e.g. terrace above), horizontal