Playing multiple music files?

How do I change music files when players click a button and have it play a different song each time going to the next one?

You can set a variable like music_random then when the player clicks the button set the
music_random = RandomInRange(1,10)
This is a pseudo and not optimized way to do it but it will work for sure.
Then prepare 10 event with 10 different songs like
if music_random = 1
Play song 1
if music_random = 2
Play song 2
and so on until 10 or the number of songs you want to put in your game

1 Like

Is there a guide to help with that? I can’t find the options for that.

I keep trying that after I found out how to do variables. It won’t go to the next song though, it plays the first one only.

Just give me some minutes and I create an example for you

Here the project with trigger once
The same example but all the songs events moved to the begin of the scene event and removed the Trigger once
Project begin of the scene


That works amazingly! Thank you!

Thanks, any chance there is a string to play the music in order?