x


How efficient is using colliders as progression markers?

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

more ▼

asked Jun 28 '12 at 07:06 AM

Ozale gravatar image

Ozale
116 17 19 27

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jun 28 '12 at 07:48 AM

Kryptos gravatar image

Kryptos
7.2k 5 33

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)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1765
x45
x30

asked: Jun 28 '12 at 07:06 AM

Seen: 291 times

Last Updated: Jun 29 '12 at 03:00 AM