- Home /
Question by
$$anonymous$$ · Nov 26, 2012 at 07:36 AM ·
errortriggerexit
OnTriggerExit wont work
I have this script so awared becomes true on the enter but no matter what itry i cant get it to become false on the trigger exit. How do i do it?
var awared : boolean = false; function OnTriggerEnter (hitTrigger : Collider) { if (hitTrigger.tag == "Player") { awared = true; } }
Comment
Best Answer
Answer by KiraSensei · Nov 26, 2012 at 10:19 AM
function OnTriggerExit (hitTrigger : Collider) {
if (hitTrigger.tag == "Player") awared = false;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613084513im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to Fix Compilier Errors? 0 Answers
Need help on a semicolon error 1 Answer
Expressions in statements must only be executed for their side-effects. 1 Answer