- Home /
Question by
Gerbo · Aug 16, 2014 at 03:34 PM ·
audiosoundaudiosourcemultiple
Multiple audioSources on same gameObject?
Hi you all.
I have a gameObject named musics with 5 audioSources, and I want to access them via other gameObject called musicButton. Is there any way to stop and play any specific audioSource of the musics object, or to simply stop and play any sound coming from the musics gameObject?
Thanks you all for the help!
Comment
Answer by Eric5h5 · Aug 16, 2014 at 04:30 PM
Make a public AudioSource array variable, and drag the AudioSource components onto the array. Then they can be addressed individually in code.
Your answer
Follow this Question
Related Questions
Buzzing Audio 1 Answer
Play sound from an array, not random, and only once 3 Answers
multiple sounds, sound....sucky 0 Answers
Random, 3d sound. 1 Answer
Intensity of sound. -1 Answers