system
1
Hi, Help me please: I want to play audio when entering a trigger and stop playing when you leave the trigger. Thank you very much
var Sound:AudioClip;
function OnTriggerEnter () {
audio.PlayOneShot(Sound);
}
function OnTriggerExit () {
???????????????????;
}
system
2
I haven’t tried it myself yet, but a quick google search turns this up right in the handy-dandy documentation:
http://unity3d.com/support/documentation/ScriptReference/AudioSource.html
Did you try:
audio.Stop();
?