#How do I have an instantiated scene notify its parent scene?

2 messages · Page 1 of 1 (latest)

fast lion
#

I have a signaling problem that I am not sure how to fix. I have my main scene. Within that scene, I instantiate a child scene. That child scene runs the actions it needs to, and once it is done I need to let the main scene know that it is done. I have function in the child scene that fires once it is done. How to I get the main scene to notice that this function is activated? I tried creating a signal in the child scene, but it only showed the option to connect to nodes within the child scene.

In summary: how do I have an instantiated scene notify its parent scene?

twilit osprey
#

from your parent script, something like this when you instantiate the child

var child_node = MY_PACKED_SCENE.instantiate()
add_child(child_node)
child_node.your_signal_fired_when_done.connect(some_func_in_parent_to_run_when_signaled)