From a637dcfdf70478d5f37cadb8217c0d19acf8682b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 13 Apr 2024 23:56:36 +0200 Subject: [PATCH] OH COME ON --- behaviours/hunter.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/behaviours/hunter.gd b/behaviours/hunter.gd index a6d21ce..5421a3c 100644 --- a/behaviours/hunter.gd +++ b/behaviours/hunter.gd @@ -12,10 +12,12 @@ var possible_targets: Array = [] func _on_detection_area_body_entered(body: Node2D) -> void: - if body.find_children("Edible", "Edible", false, false): - Log.p(self, "Tracking a new target: %s" % body) - possible_targets.push_back(body) - tracked.emit(body) + var edibles: Array = body.find_children("Edible", "Edible", false, false) + for edible in edibles: + if edible.tag == tag: + Log.p(self, "Tracking a new target: %s" % body) + possible_targets.push_back(body) + tracked.emit(body) func _on_detection_area_body_exited(body: Node2D) -> void: if body in possible_targets: