How do i filter the array to return all the watermelons, to have smthn like this:
[watermelon:<Node3D#31121737004>]
I also tried making a function to do this but it’s just returning […]
(by “…” i mean nothing. i just had to put “…” because of formatting)
_get_nodes_in_array(get_node("watermelon"), get_tree().root.get_children()[0].get_children())
func _get_nodes_in_array(type, arr):
var nodes = []
for i in arr.size():
if arr[i] == type:
nodes.append(arr[i])
return nodes
im new to godot so i might ask alot of followup questions