Edge Collider vs Box Collider vs Polygon Collider?

Hi! I was reading the colliders documentation and I can not seem to find how these colliders perform. When am I supposed to use edge, polygon or a compound collider made out of box colliders? What is best for mobile devices?

Thank you for your time guys!

1 Like

Build Tests > Profile.

Only real and non-time wasting method to be sure the kind of game you want will run on the kind of devices you want.

1 Like

Think about it this way. A collider that has more sides to it, takes longer to process collision events on. The best performance comes from a circle colider. Then slightly worse performance from edge or box colliders. Then the worst performance from polygon colliders. If you have very few of these colliders in your game then you won’t notice any difference. But if you have hundreds of these colliders in your game then you WILL notice a difference.

1 Like

But then circle has infinite sides !!! , how come it has best performance ?

For a circle, the collision check is “Has another object touched the radius of the center point of this object”
For a polygon, the collision check is “Has another object touched an edge from the center point of this object”

Box colliders are really just polygon colliders in the shape of a box.

–Eric

2 Likes

What is better an edge collider with 10 certs enclosing a convex shape or a polygon collider with 10-20 certs enclosing same shape?

And how much more expensive than a sphere double, 10x, 100x?

Thanks again for any tips

1 Like