|
G'day guys, I have a simple question regarding one use of colliders. I'm drawing up plans for a third-person project, where the player will explore an indoor environment, filled with rooms and hallways. I'd like to create empty gameobjects with box colliders, behaving as triggers, so that I can track which section of a level the player is in, so that I can trigger events. My only question is this: how much does a collider employed in this manner affect performance? If I used OnTriggerEnter/Exit, it could be as simple as two events code-wise, but I thought I'd see if anybody else uses them for this kind of purpose. Cheers, -Stew
(comments are locked)
|
|
I you use static triggers, the performance overhead would be minimal. If you plan to make these triggers move, then add a kinematic rigidbody on it. Otherwise, don't forget to mark them as static. I used it a lot in a car racing game where the road was generated on the fly (each trigger would "trigger" the generation of another piece of road). And this even worked fine on mobile. Thanks Nicolas. I plan on using them as purely static objects, maybe 10-20 in a scene at a time, and none of them will move. Could you send me a link to your car racing game? Sounds interesting.
Jun 29 '12 at 03:00 AM
Ozale
(comments are locked)
|
