![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Thakee Nathees |
i want to emit a signal from one scene to another with an argument. please help me with a simple script. thank you.
Have one script emit a signal (ensure that this script is attached to a node). Go into the Inspector and select the created signal. Select the receiving script, and place the function which is to receive that signal into the receiving script.
For example, you have a signal
signal play_music
Which is emitted in some function
func song():
emit_signal("play_music")
You then connect it to the node named Music
via the Inspector. In the script for Music
you write a function such as
func on_play_music():
# Play good tunes here
Hope that clears things up. For more info, check out the signals documentation.
Ertain | 2019-06-21 00:12