From ad9e8d62fadf0959b0dd5f57ce22ee11f7370156 Mon Sep 17 00:00:00 2001 From: SnekInAScarf Date: Sat, 31 Oct 2026 15:54:15 -0700 Subject: [PATCH] Stop the edge sensors from hitting the player's own collider Since the sensors moved under the EdgeSensors pivot, exclude_parent excludes the pivot rather than the player. With edgeSensorRange equal to the slime's radius the rays start on the edge of its circle and hit it, so edge wraps never triggered. Add the player as an exception. Co-Authored-By: Claude Opus 5.5 --- Characters/player.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Characters/player.gd b/Characters/player.gd index 70dfa46..f0754c6 100755 --- a/Characters/player.gd +++ b/Characters/player.gd @@ -92,6 +92,10 @@ func _ready() -> void: leftEdgeSensor.target_position = Vector2(0, sensorDepth) rightEdgeSensor.position = Vector2(edgeSensorRange, 0) rightEdgeSensor.target_position = Vector2(0, sensorDepth) + # The sensors' parent is the EdgeSensors pivot, so exclude_parent doesn't + # cover us. Without this they can hit our own collider. + leftEdgeSensor.add_exception(self) + rightEdgeSensor.add_exception(self) # Rotates the sprite to sit on the wall or ceiling. Done in _physics_process # (not _process) so physics interpolation smooths it along with our movement.