1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-24 17:14:23 +00:00

OH COME ON

This commit is contained in:
Steffo 2024-04-13 23:56:36 +02:00
parent 630eb88f22
commit a637dcfdf7
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -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: