Quick answer: Unity Tilemap2D collision rebuild taking 200ms+ on a 100x100 tile map? CompositeCollider2D regenerates the whole shape per update - bake offline or update affected chunks only.

Procedural generation runs CompositeCollider2D.GenerateGeometry per tile change. Frame freezes during gen.

Update chunks only

For large maps, split into 16x16 sub-tilemaps. Modify only the affected sub-tilemap; rebuild collision only there.

Or pre-bake

Offline tools that bake collision once; load at runtime. Avoids runtime cost entirely.

Use Optimization parameter

CompositeCollider2D > Optimization > Don't Trim. Skips the trim pass that's a significant share of the cost.

“Composite collider regen is O(n). Large maps hit the linearity.”

For procedural worlds, chunked architecture is non-optional. The pattern affects every system, not just collision.

Related reading