From c212748b8d221525bfcb6d5813844fb00311b6a1 Mon Sep 17 00:00:00 2001 From: SnekInAScarf Date: Sat, 31 Oct 2026 15:14:07 -0700 Subject: [PATCH] Don't treat tile seams or the foot of a wall as an edge The level's TileMapLayer is made of separate collision shapes, and the ray that looks for the side of a platform could hit the inside face of a neighbouring tile. That made walking along the floor stop and "hold" at tile seams and next to walls. A corner now only counts as an edge if there's empty space just past it, behind the surface. Co-Authored-By: Claude Opus 5.5 --- Characters/player.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Characters/player.gd b/Characters/player.gd index f23e09f..70dfa46 100755 --- a/Characters/player.gd +++ b/Characters/player.gd @@ -383,7 +383,11 @@ func _find_edge_corner(normal: Vector2, dir: Vector2, reach: float) -> Variant: var line: Vector2 = surfaceHit.position - normal * 2 + dir * (pos - surfaceHit.position).dot(dir) var faceHit := _cast_ray(line + dir * reach, line - dir * radius) if not faceHit or faceHit.normal.dot(dir) < 0.5: return null - return faceHit.position + normal * 2 + var corner: Vector2 = faceHit.position + normal * 2 + # A real edge has empty space just past it, behind the surface. Seams + # between tiles (and the foot of a wall) have solid there, so they're not edges. + if not _is_point_free(corner + dir * 2 - normal * 2): return null + return corner # If this frame's movement along the surface would take us past its edge, stop # at the edge instead, until we've held towards it for MAX_SECS_TO_UNSTICK.