Trigger collision cost?

Hi,

I have a few models which I have to be able to raycast against, hence they have been assigned colliders set to trigger.
These objects will frequently collide with other objects, collisions which are uninteresting.

How exactly does Unity handle these collision events? Will they incur a performance penalty even if they aren't acted upon in any way?
Will I benefit from using IgnoreCollision for all possible "uninteresting" pairs (which feels a bit cumbersome, although very doable)?

Thanks in advance!
Dan

Are you raycasting so you can get OnMouseDown type events? I have collider with isTrigger false on my objects I just want nouse events but not collisoins with. They still collide with rigid bodies that are triggers but not each other since they are not rigid bodies.

I get maybe 8 10 40 collisions per frame between my rigid boy trigger colliders and these colliders that I ignore with no noticeable cost.

cheers,
Grant

Yes, exactly - I need to detect mouseups and be able to raycast to get the world position from the click.

I have understood from past posts that the performance cost is small and on the verge of ignorable, but I would still be interested in a more efficient way. I imagine the cost goes up as the number of colliding objects increases (which they will in my case).

Any ideas?

You say [quote]
I have a few models which I have to be able to raycast against, hence they have been assigned colliders set to trigger.
[/quote]

but they don't have to be triggers to get mouse events, just have colliders. If you have no trigger and no rigid bodies they will only cause trigger events when collided by rigid bodies withe triggers. If they are rigid bodies then you are doing physics with them and you have no choice you are using the collision implicitly in the physics.

in Summary
a) you can probably remove the triggers from these bodies and decrease the collisions.
b) I don't know how much collisions cost.

Cheers,
Grant

If you have no trigger and no rigid bodies they will only cause trigger events when collided by rigid bodies withe triggers.
[/quote]

That may be true, but they'll still send collision events? The question is what the cost is for those (if any) and if there's a way to avoid the physics collison/trigger events and still be able to collect mouseups and raycast info. :)
Iterating through basically all game objects and setting ignorecollision for these and any new objects seems like a cumbersome workaround IMHO. :)

Cheers,
Dan

Here's a story that may serve as indirect advice:

At seriousgames we got a city up and running with everything just working. After having coded 2 years on it, we spent one week at the end of production making the whole thing 2-3x as fast. The optimizations were all trivial - and just about all the optimizations that we had in the first place turned out to be a waste of time (not to mention hell to debug).

=======
In short, don't worry. If Unity does something, it's FAST (trust me on this ;-). If it turns out to be a performance problem anyways, you can always fix it later.

Right - point taken. :)
Just wanted to make sure I didn't go about things the wrong way.

While the documentation for Unity is pretty good, I think it's a bit light when it comes to explaining how things work behind the scenes. It's hard to judge whether one approach would be better than another when there's pretty much no information as to which operations are taxing on performance and which aren't.

Well, I guess it's the trusted trial and error approach then. ;)

Cheers,
Dan