Hi everybody! I have successfully done several cases of emitt signal and connect. But I have a problem as for example:
World's script:
func _ready():
var abc = get_tree().get_root().find_node("menu",true,false)
abc.connect("open" ,self, "do_something")
Menu's script:
signal open
func _ready():
emit_signal("open")
In this case, because the Menu node has not been initialized, only when a button is pressed or do something, the Menu node will be initialized. So Godot will give an error "Connect null instance..."So in this case, how do I code to solve this problem? I always have this situation and don't know how to fix it. Want to connect to a node that does not exist.Hope you can guide me.I'm new to coding. Thank you so much.