16 lines
218 B
GDScript3
16 lines
218 B
GDScript3
|
extends Area2D
|
||
|
|
||
|
var player = null
|
||
|
|
||
|
|
||
|
func _on_PlayerDetectionZone_body_entered(body):
|
||
|
player = body
|
||
|
|
||
|
|
||
|
func _on_PlayerDetectionZone_body_exited(_body):
|
||
|
player = null
|
||
|
|
||
|
|
||
|
func is_player_detected():
|
||
|
return player != null
|