OnTriggerEnter vs distance check in Update
I need to make some triggering zones. So I faced the question, if it is better to: - use OnTriggerEnter() using collider ( like BoxCollider ), with a layer and a physics matrix set to detect only the objects that I'm intrerested in , without any unnecessary objects, - or loop over all objects that would be stored in some static List in Update() method and check each objects position manually?
Lets say that I've got like 100 objects to be scanned, and about 30 triggering zones.
To my opinion the first solution should be faster, because of many optimalizations that the physics engine does. Am I right?
Answer by anamta93 · May 13, 2016 at 11:35 AM
i had the same kinda question, so what i did; i used a co-routine and made it run twice a sec, so it is much faster then any other thing. if u want faster, u can run that 4 times with delay of 0.25 seconds :)
Your answer
Follow this Question
Related Questions
Performance Issue While Near One Specific Object 0 Answers
Trouble with collison and trigger's 1 Answer
Can I use a particle system for critical game functionality? 0 Answers
Ball going through and sticking to flippers in a pinball game 1 Answer
Player's collider not detecting hits from animated enemy 0 Answers