PlayerRadar

mail@pastecode.io avatar
unknown
plain_text
8 days ago
480 B
1
Indexable
Never
extends Node2D

@export var enemy_parent : Enemy

func _on_chase_player_body_entered(body):
	if body.name == "Player":
		enemy_parent.can_chase = true

func _on_chase_player_body_exited(body):
	if body.name == "Player":
		enemy_parent.can_chase = false

func _on_attack_player_body_entered(body):
	if body.name == "Player":
		enemy_parent.can_attack = true

func _on_attack_player_body_exited(body):
	if body.name == "Player":
		enemy_parent.can_attack = false
Leave a Comment