- Home /
Different music options in one scene depending on conditions
Hello all. I have a singleton method MusicChange script which I have used in the past to keep music playing throughout until there is a call on scene to change it. This is the first time I am using the script to have numerous possible tracks in one scene.
In the game, players can choose between modes "Timed" and "Lives" and then "Easy", "Medium", or "Hard." With this, I have 6 possible tracks to play on the scene based on all possible combinations (Timed/Easy, Lives/Medium, etc).
I am using a long if-statement to determine which track will play in the gameplay Scene. It successfully plays the track I want depending on conditions, but will not loop when this script normally automatically loops my music until a new track is called. Anyone have any ideas why this would be? Thanks very much.
Answer by tanoshimi · Nov 22, 2016 at 08:49 AM
You need to tick the Loop checkbox on the AudioSource component that plays the music clips. https://docs.unity3d.com/Manual/class-AudioSource.html
Wow, that's really all it was. Thanks a bunch and sorry I didn't realize that myself sooner