I have some simple bird song attached to my character controller (Audio Source) and wanted to know if there was a way to change the current audio source when a trigger is hit to something else. For instance:
Bird song is playing > When trigger is hit > Bird song stops > Zombie Sound effect takes over.
Or something similar.
asked Nov 30 '10 at 11:32 AM
Take a look at the answers to this question: http://answers.unity3d.com/questions/4795/what-is-the-script-code-on-how-to-trigger-a-song-for-the-player-to-listen-to
It's not the same question as yours, but nonetheless, the code there shows how to play an audio clip that was assigned via the Unity inspector. You can easily declare two audio clips, set one the the bird song and the other to the zombie, and play either one whenever you want.
answered Nov 30 '10 at 04:12 PM