Sound scripting

hello there,

i put a music in my “Main Camera”,

also want to put more sound over it, so user can change music with a [3D GUI Text+Box collider].

i see references, but the reference of unity is hopeless , there’s lot of bug inside, and there’s lot of thing that even didn’t noted. can any one give me the code, for change music?

If you have an AudioClip available to your script (say as a public variable set from the inspector), you can play it using AudioSource.PlayOneShot:-

var clip: AudioClip;
   ...

audio.PlayOneShot(clip);