- Home /
Question by
$$anonymous$$ · Aug 22, 2013 at 03:24 PM ·
audiotriggertimewait
Is there a way to wait a certain amount of time before the audio plays again
I need to have my script so when the enemy is visible in the trigger zone it plays a sound this is the script I use
function OnTriggerStay(other : Collider){
if(other.gameObject.tag == "Player" && renderer.isVisible && !audio.isPlaying){
audio.Play();
}
}
How do I make it so after the audio is played it has to be another 20 seconds before it plays, Other wise it constantly repeats until you leave the trigger zone, I want the scare noise to only play once so it actually scares them
Comment
Your answer
Follow this Question
Related Questions
trigger audio and text from array 0 Answers
Play Audio on Key Press when within trigger or use raycast?? 2 Answers
Multiple Audio Sources On One Object 0 Answers
Rate of health loss in trigger box. 1 Answer
Need help on audio trigger. 2 Answers