Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Jack J |
I am trying to understand how signals work. I have two scenes, Main, and Scene01. Both have root nodes Main and Scene01. Both of these nodes have scripts attached. An instance of the Scene01 node is a child of the Main node.
The script attached to the Scene01 node is this:
extends Node
signal send_to_main
func _ready():
print("Scene01 _ready")
emit_signal("send_to_main")
The script attached to the Main node is this:
extends Node
func _ready():
print("Main _ready")
self.connect("send_to_main", self, "_message_received")
func _message_received():
print("Received message")
Why does “Received message” not print?