Mesh vs Sphere vs Box Collider Performance?

Hello everyone. I just want to know if any of these gives different performance? I am building a game for mobile so I want it as fast as possible. I searched around and cannot see anything about this. Do you know if Mesh is needs much heavier process than a box or a sphere? Thank you.

1 Answer

1

Yes, a mesh collider is much more CPU-intensive than a box or sphere collider.

A sphere collider definitely doesn't check every point on the sphere; that's impossible since there are an infinite number of such points. It only has to check the radius and that's it, plus it's exactly the same no matter how the object is rotated (Unity doesn't support non-uniform scaling for sphere colliders). You can google "sphere collision detection" if you want to know details about how it's coded.

Thank you for your additional information. I have learned a lot now with the suggested search string. And you also helped demystify how a collider works.

Sphere is fastest (distance check only), box is a little slower (intersection check), but not that much. Mesh (escpecially if done poorly) can be really expensive.

I thought a box collider is much more faster than a sphere. so I will use sphere colliders for non interactable objects now. I need colliders for InstantOC to work.