- Home /
Other
How to detect if a trigger is empty?
Hello, i'm wondering if anyone could help me with my script. If the trigger is active, the player should stay alive if he clicks. And if the trigger is empty, Scene2 should appear. Thanks for your time! :-)
https://answers.unity.com/storage/temp/110255-question1.png https://answers.unity.com/storage/temp/110256-question11.png
Answer by KittenSnipes · Jan 29, 2018 at 03:59 AM
Use OnTriggerExit(Collider other). It pretty much states that if the collider that was in the collider exits it then return. It is as easy as that.
I fixed it by adding another collider around the area of the trigger and then used OnTriggerStay(collider other), still thank you XD
Follow this Question
Related Questions
Character and enemy don't damage each other 1 Answer
My camera is not working, nor are my bullets? 0 Answers
Add script to created gameobject via script 0 Answers
a script to prevent lucky patcher from hacking my app 1 Answer
Every script says "can not load script" and that there is no monobehavior in the file 2 Answers