# Random Song Selection in Unity

**URL:** <https://qa.fmod.com/t/random-song-selection-in-unity/15111>\
**Category:** Unity\
**Created:** [October 8, 2019, 12:07am UTC](https://qa.fmod.com/t/random-song-selection-in-unity/15111 "2019-10-08T00:07:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevtronix](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@trevtronix](https://qa.fmod.com/u/trevtronix)\
**Post date:** [October 8, 2019, 12:07am UTC](https://qa.fmod.com/t/random-song-selection-in-unity/15111/1 "2019-10-08T00:07:30Z")

</div>

I have three events in FMOD that are all different music tracks. Is there a way in Unity to select one of the three songs at random at the start of the gameplay?

---

<div class="post-metadata">

**Author:** ![alexzzen](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alexzzen/32/6825_2.png) [@alexzzen](https://qa.fmod.com/u/alexzzen)\
**Post date:** [October 8, 2019, 1:33pm UTC](https://qa.fmod.com/t/random-song-selection-in-unity/15111/2 "2019-10-08T13:33:35Z")

</div>

Haven’t tested this, but I think you can:

1. Use an Multi Instrument set to Async (Shuffle or Random mode):

![grafik](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/965c0e0b5ca5f311cf3c475a4854da85109370df.png)

1. Insert your tracks into a single Event and use a Game Parameter with a Random Modulator to jump to a random song at the start of the Event:

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/0524307937ca7cbea7ea6b92aef897612a920a93.png)

1. Simply use [Random.Range](https://docs.unity3d.com/ScriptReference/Random.Range.html) in the code and manually play an event based on the return value.
