I was making a mushroom spawner for my game but I ran into a problem
I needed the mushrooms to automatically connect to the main scene, and it works, but only for the first one because spawned objects get numbers at the end like Mushroom, Musroom2, Mushroom3, e.t.c. (I have no idea how it's called)
I need to make it so it applies to every numerated object, but I have no idea how. Help!!
I need to change it in find_node
but i have no idea how
func _ready():
var mushnode = get_tree().get_root().find_node("Mushroom", true, false)
mushnode.connect("mushroom_collected", self, "_on_Mushroom_mushroom_collected")