To create a randomized playlist, you must create an Audio Random Container and then play it in the game.
You can use a randomized playlist to randomize and play almost any sound, such as footsteps, impacts, and AI dialog.
You can create and use a randomized playlist if you know how to do the following:
You can create an Audio Random Container from more than one place.
Note: If you drag an existing Audio Random Container to the Hierarchy, you create a GameObject at the Transform location (0,0,0) with an Audio Source component that references the dragged Audio Random Container.
In the Unity Editor, do the following:
An empty Audio Random Container asset appears in the Project window under Assets.
In the Unity Editor, do the following:
An empty Audio Random Container asset appears in the Project window under Assets.
In the Unity Editor, do the following:
An empty Audio Random Container asset appears in the Project window under Assets.
To play an Audio Random Container, you must integrate it with the Audio Source component and then play it, such as with one of the game trigger options.
You can only use the Audio Random Container in conjunction with the Audio Source component. It’s the emitter for the Audio Random Container and determines whether the Audio Random Container has a position in the world or sounds like it doesn’t have a position. For more information, refer to Audio Source.
To integrate, do the following:
You have integrated the Audio Random Container with the Audio Source component. You can play it with the PlayOnAwake bool, the API, or the different game trigger options.
Sounds in games are often triggered by a game event or by a trigger. You can use game triggers, such as buttons, to play the Audio Random Container\: