- Home /
How do I create an array under audio source
I have a single object that I have attached an audio source to. I want to be able to have an aaray to load multiple songs and put it on a loop so that it goes through each song then repeats if a game character were to just stand in the same spot within range of this object. Please help!!!!
Answer by mstevenson · Nov 17, 2012 at 08:33 AM
You'll need to create a new script and attach it to the same object as the AudioSource. This script should contain a public array of AudioClips which you populate through the inspector. In the playback logic in your script, you may load individual AudioClips into the AudioSource component.
Your answer

Follow this Question
Related Questions
Is there a more efficient way to trigger an audio source from an array to play than using a timer? 0 Answers
3D array flattening / unflattening to / from compute shader 1 Answer
Instantiate duplicates script in subsequent Objects 2 Answers
how subtract total value element of array ?? 1 Answer
Static array with custom class? 1 Answer