From 7ffcf54d80aa330c2677b2e9c002d775d7cb4efa Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sun, 5 Apr 2026 00:58:10 -0400 Subject: [PATCH] NS-23: horizontal nav steering so bump-top departure works Path waypoints from the plateau often sit on the slope almost under the player (same xz, lower y). 3D steer + y clamp gave almost no horizontal velocity, so standing on top then clicking off looked stuck. Steer in xz at MOVE_SPEED and let move_and_slide follow floor/slope; keep 3D only for vertical climb when xz is aligned. --- client/scripts/player.gd | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/client/scripts/player.gd b/client/scripts/player.gd index a79476a..05caaea 100644 --- a/client/scripts/player.gd +++ b/client/scripts/player.gd @@ -40,13 +40,25 @@ func snap_to_server(world_pos: Vector3) -> void: func _steer_toward_world_point(point: Vector3) -> void: - var delta: Vector3 = point - global_position - if delta.length_squared() < 1e-8: - velocity = Vector3.ZERO + var pos := global_position + var delta_h: Vector3 = Vector3(point.x - pos.x, 0.0, point.z - pos.z) + # Full 3D toward a waypoint that is mostly *below* (same xz, on the slope) while standing on + # the plateau yields almost no horizontal speed, so you never reach the rim. Nav in xz + floor + # slide handles ramps and departure from bump tops. + if delta_h.length_squared() > 1e-8: + velocity = delta_h.normalized() * MOVE_SPEED return - var desired: Vector3 = delta.normalized() * MOVE_SPEED - desired.y = clampf(desired.y, -MAX_DESCENT_SPEED, MAX_CLIMB_SPEED) - velocity = desired + var dy: float = point.y - pos.y + if dy > 0.08: + var delta: Vector3 = point - pos + if delta.length_squared() < 1e-8: + velocity = Vector3.ZERO + return + var desired: Vector3 = delta.normalized() * MOVE_SPEED + desired.y = clampf(desired.y, -MAX_DESCENT_SPEED, MAX_CLIMB_SPEED) + velocity = desired + else: + velocity = Vector3.ZERO func _physics_process(_delta: float) -> void: