extends Area2D var player = null # Called when the node enters the scene tree for the first time. func can_see_player(): return player != null func _on_PlayerDetectionZone_body_entered(body): player = body func _on_PlayerDetectionZone_body_exited(_body): player = null