crei0

joined 1 year ago
[–] crei0@mastodon.gamedev.place 1 points 1 year ago (1 children)

@plixel @Rodeo
The way I'm doing in my game is by

  1. Using a Signals.gd script

  2. Add that script to Project settings > Autoload, this makes the script globally accessible (singleton)

  3. Then from the scene I want to send the signal, I do
    Signals.my_signal_was_triggered.emit()

  4. Then on the scene/node (can by multiple) I want to receive the signal emission, I do
    Signals.my_signal_was_triggered.connect(my_function)

  5. Create the function "my_function"