- Home /
I want the examiner in an area to perceive that there are no enemies around, but when he detects the player, he immediately opens the door, even if there is an enemy inside, how can I fix it?
public GameObject arkaKapı; void OnTriggerExit (Collider2D col) { if(col.gameObject.tag != "Enemy" && col.gameObject.tag != "bakplan" && col.gameObject.tag != "bullet"){ Destroy(arkaKapı); print (col.gameObject.name); } }
watf.png
(6.6 kB)
Comment
Your answer
Follow this Question
Related Questions
Trying to make object turn red OnTriggerEnter 0 Answers
Why my "Is Trigger" box colliders are physically colliding with other colliders? 1 Answer
spawning problem 1 Answer
Trigger work on full enter 3 Answers
Decreasing a variable with triggers? 0 Answers