Instances and signals

Godot Version

Godot 4

Question

i have a player scene intantiated in the main one and the player’s signals are connected only in the main scene. So when i tried to instance antoher player it appears without signals. How can the instance appears as the first one?

1 Like

Each object has its own signals connected.

A Button for instance. you won’t wish the pressed signals of all the buttons to be emitted, when just a single button is being pressed, it doesn’t make any sense right?

You could make a global node, like an auto-load, and code signals in there (such as level_completed, player_died, and player_respawned for example).

2 Likes

If you want to instantiate the scene in runtime, you should connect the signals in code:

player_scene.custom_signal.connect(_on_player_custom_signal)
2 Likes