I have the following script, that gets triggered by an othe script. I want it to play a sound only once, but it keeps playing the sound over and over. What shoul I do?
var trig : boolean;
var sound : AudioClip;
function Update ()
{
if(trig && !sound.IsPlaying)
{
audio.PlayOneShot(sound);
}
}