I have two enemies that start shooting at my player when he enters a trigger. I was going to have them stop shooting when he exited the trigger. The “danger” area is pretty big though and Im wondering if OnTriggerExit keeps checking every frame that the player is inside the trigger. If this is the case would having an OntriggerEnter at the end of the danger Zone be more efficient. I can have that trigger shut off the shooters when my player enters it. That way Unity will only check once when my player enters the first trigger and once when he enters the second trigger. Just seems better for performance to me but I’m not sure.
There is OnTriggerEnter, OnTriggerStay, and OnTriggerExit. Enter is called when an object enters the trigger, exit called when it exits, and stay is called every update the object is inside I would call OnTriggerStay only if you have to. Using the enter and exit functions are generally sufficient.