Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Spafnar |
Hello, in my newgame function, I have the following script which allows me to utilize an array and have the engine randomly select a song and play it:
var _music_list = (["the songs i saved the paths for"])
var song = _music_list[randi() % _music_list.size()]
$AudioStreamPlayer.stream = load(song)
$AudioStreamPlayer.play()
The issue is that after playing for long enough, after the song ends, it is just quiet. I orginally had added
if $AudioStreamPlayer.stop()
$AudioStreamPlayer.stream = load(song)
$AudioStreamPlayer.play()
I know that the stream is never manually told to stop so I didn’t think this would work, nevertheless, it still remains quiet, but I dont get any warnings or errors. Does anyone know if there is a code that would allow the engine to randomly select another song after the current one ends?