Does Polygon Collider 2D node count really matter

When I make 2D objects with polygon colliders on them I always change the shape that unity generates automatically because I think it has too many nodes and will impact the performance. In most cases, I cut node count by 50-70%.

For example, Unity automatically generated this:


and I changed it to this:

So I optimized the path from 73 to 26 nodes.

But is my work really necessary? Will this affect performance in any way if my scene will have about 300-400 such objects?

The physics doesn’t understand outlines. The PolygonCollider2D uses a geometry library to break the outline down into convex polygon shapes it can use. You can see that in the inspector in “Info > Shape Count”. You can also see those shapes in the gizmos. You should endeavour to keep the shape count as low as possible. If matters much less if it’s not moving though.

1 Like