Right now I have this script on a collider so it plays spooky music when my FPS player walks into it. but the problem I'm having is lets say my player hears the spooky music begin to play and descides "Say I better go back and get that shotgun!" and they accidentally trigger the music collider again so the music cuts off and begins to play again. How can I make it so it won't do that? That it will continue to play right through even if the player backs into the collider again,
var spookyStoneCircle : AudioClip;
function OnTriggerEnter(col : Collider){
if(col.gameObject.tag == "Player"){
audio.clip = spookyStoneCircle;
audio.Play();
yield WaitForSeconds (audio.clip.length);
Destroy(gameObject);
}
}
Yeeeahhh! perfect, thankyou... I thought it was just a simple line of code i was missing. I was trying to see if I could find something on the script reference but none of the examples they were giving me were helping, this however is PERFECt and does EXACTLY what I needed! AWESOME!! :D :D
– anon48034950