Topic was automatically imported from the old Question2Answer platform.
Asked By
Dava
Old Version
Published before Godot 3 was released.
I am trying to get random music to play on my app, when the user runs the program, a random music will play and when it finishes, it will choose another random music, with this code:
Only the first music in the list music_one plays and when it finishes, no other music plays, I also want music to keep playing even when the user changes scene but I don’t know how to do that
_ready() only executes itself 1 time. You should use a signal (in StreamPlayer the signal is finished ()) and connect this signal to the main node. In the _on_finished function (i don´t know if this is the name, look at the signals of StreamPlayer in inspector) you can “replay” or whatever you want.`
Place backticks: ` around code snippets to keep from interpreting _ as formatting code: