Is there a reason to use simple colliders for objects rather than a complicated exact collider other than saving time? For instance is a polygon collider inefficient at a large scale with many game objects in the scene?
Im still learning myself, but i guess a box collider, is basically a polygon collider with 4 vertices.
So probably depends on how you shape the polygon collider.
But as far as i know you should not really worry about this in 2d colliders.
If you go 3D with meshcolliders, you get pretty “expensive” colliders.,
then you could probably notice the difference when you have a populated scene.
But maybe someone with more knowledge can tell you more about it
Hi Roskal,
A BoxCollider2D is probably more performant than a PolygonCollider2D, even though RustyNail is right regarding the number of vertices. I believe that’s the case because a BoxCollider2D is not able to change its shape. Since a PolygonCollider2D can have more vertices, Unity cannot make any assumptions but has to evaluate everything.
For this reason, we would almost always prefer a BoxCollider2D in a larger game, and we would use other colliders only if it is absolutely necessary. For example, a round object such as a ball should have a CircleCollider2D attached. A round enemy which just moves back and forth and which we are able to shoot does not necessarily need a more precise collider shape if a BoxCollider2D provides the same result.
Has your question been answered?
See also:
- Forum User Guides : How to mark a topic as solved
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.