0 votes

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")
Godot version 3.2.3
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.