---
title: Collider Composition
category: product
entity_type: skill
price: $15
canonical: https://forgehouse.ai/skills/collider-composition/
lang: en
hreflang_alt: https://forgehouse.ai/tr/skiller/collider-composition/
last_updated: 2026-06-20
---

# Collider Composition

> Compose Unity 2D physics colliders CompositeCollider2D merge, multiple PolygonCollider2D…

Stops the collider explosion that drags Unity 2D physics to a crawl. It composes scattered box and polygon colliders under a single CompositeCollider2D, separates trigger from solid via a physics layer matrix, and tunes the physics step so a level packed with hundreds of tiles still holds frame rate on low-end mobile.

## Use cases
- Merge hundreds of tile colliders into one composite outline
- Separate NPC interaction triggers from solid bodies
- Configure a deny-by-default physics layer collision matrix
- Stop fast projectiles tunneling through walls
- Regenerate composite geometry for dynamic doors
- Cut physics step time when the Profiler shows a bottleneck

## Benefits
- Collapse hundreds of tile colliders into a handful of merged outlines
- Hold mobile frame rate by tuning the fixed timestep and iteration counts
- Skip irrelevant collision pairs so the broad phase does far less work
- Eliminate the 'character stuck in wall' and ghost-through-wall bugs that tank reviews

## What’s included
- Canonical CompositeCollider2D prefab structure and auto-configure Reset() script
- TilemapCollider2D plus CompositeCollider2D integration for merged outlines
- An 8-layer physics layer scheme with a full collision matrix
- An AssetPostprocessor that enforces the UsedByComposite flag on child colliders
- A dynamic door pattern that regenerates geometry and invalidates pathfinding
- Platform-specific physics tuning and a post-implementation verification checklist

## Who it’s for
For Unity 2D/2.5D game developers whose tilemap-heavy scenes are choking on collider count and physics step time, especially when targeting low-end mobile.

## How it runs
Profiler first, opinions later: 500 tile colliders showing 8-12ms of physics time is the baseline to beat. Merging, layer matrix pruning and per-platform step tuning bring it under 1ms on mobile.
1. Measures first: opens the Profiler and reads Physics2D.Simulate time and total collider count. A tilemap with 500 individual tile colliders typically shows an 8-12ms physics step, which is the baseline to beat.
2. Merges colliders under a CompositeCollider2D parent: TilemapCollider2D and PolygonCollider2D children get UsedByComposite set true (an AssetPostprocessor auto-fixes any that are missed), the parent Rigidbody2D is forced Static, and geometry type Outlines turns 800 tile colliders into roughly 40 merged edge chains.
3. Separates trigger from solid: a wall or NPC body is a solid collider on the Solid layer, while interaction radius is a second collider on its own Interaction layer with IsTrigger true. Toggling IsTrigger on a single shared collider is the bug that lets players walk through walls.
4. Rewrites the Layer Collision Matrix deny-by-default: out of 256 possible layer pairs only the roughly 22 that matter stay enabled (Player vs Solid, Projectile vs Enemy...), which cuts broad-phase checks by about 35 percent.
5. Tunes the physics step budget per platform: mobile gets a 20Hz fixed timestep with reduced velocity and position iterations, fast projectiles get Continuous collision detection so they stop tunneling through walls.
6. Handles dynamic geometry last: every door open or close disables the child collider, calls GenerateGeometry on the composite, and invalidates the pathfinding grid, then the checklist verifies Physics2D.Simulate lands under 1ms on mobile.

## FAQ
### Does this fit a Tilemap-based scene, or only hand-placed colliders?
It is aimed squarely at tilemap-heavy 2D and 2.5D scenes, merging the scattered tile colliders into one CompositeCollider2D outline. That is exactly the case where collider count drags the physics step down.

### If I merge hundreds of colliders into one, does collision behave differently?
The composite keeps the same solid outline, so what blocks the player still blocks the player. Triggers are split onto their own physics layers, so an NPC interaction zone stays separate from a solid wall rather than getting merged into it.

### Will this fix my frame rate if colliders are not the real bottleneck?
No, it targets collider count and physics step time specifically. If your drop comes from draw calls, scripts or garbage collection, the gain here will be small and the fix belongs in that system instead.

## Price
$15, one-time, no subscription. VAT included.

Related guide: [A 2.5D isometric game-dev AI workflow with Unity](https://forgehouse.ai/guides/unity-isometric-ai-workflow/)
