#How can i connect a signal between 2 scenes
3 messages · Page 1 of 1 (latest)
load bob scene file (.tscn / .scn):
var bob_scene: Packedscene = preload("res://BOB.tscn")
instance the scene:
var bob_instance: Bob = bob_scene.instance()
add the instance to the tree:
add_child(bob_instance)
connect signal "signal_name" to method "method_name"
bob_instance.connect("signal_name", self, "method_name")
if you want to connect a signal from one instance to a method in another instance:
bob_instance.connect("signal_name", other_instance, "method_name_in_other_instance")
Godot Engine documentation
In this lesson, we will look at signals. They are messages that nodes emit when something specific happens to them, like a button being pressed. Other nodes can connect to that signal and call a fu...