Sending signals.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nick888

Can we send a signal from a node that belongs for example to scene 2, to a node that belongs on scene1;

Thank you

:bust_in_silhouette: Reply From: kidscancode

Signals can be connected between any two nodes. You just need a reference to the source and destination nodes.

The syntax to connect a signal in code is:

<emitting_node>.connect(<signal_name>, <destination_node>, <destination_method>)

“Scene” is an organizational concept. When you save your node structure you can organize it into groups we call “scenes”. However, when we instance those scenes, they just become nodes in the scene tree.

You can see this if you look at the Remote Scene Tree while your game is running. Run the game and in the editor click “Remote” at the top of the Scene tab.

Thank you very much!

Nick888 | 2019-05-31 04:12