- Home /
Detect if out of trigger
i have a trigger that starts playing sound when players enter inside collider, what i want to make is to stop the sound playing when he exits the collider sound script:
function OnTriggerEnter(other: Collider){
audio.Play();
}
Comment
Best Answer
Answer by DaveA · Aug 22, 2013 at 07:57 AM
function OnTriggerExit(other: Collider)
{
audio.Stop();
}
But you knew that, because you read about it in the Scripting Reference right?
Answer by Bloker · Feb 22, 2014 at 04:00 AM
If gameobject's speed is higger then function OntrggerExit() update, this function may be not call.
Your answer
Follow this Question
Related Questions
animation and sound on collide 1 Answer
Play Sound on trigger 2 Answers
Controller Collider Script 1 Answer
Need help making an audio trigger. 2 Answers