Unity collider answer

Unity Collision Layers: Fix the Layer Collision Matrix Before Rewriting Code

If some objects collide and others never do, the fastest explanation is often a layer rule rather than broken collision code.

1. Check the GameObject layers first

Confirm both objects are actually assigned to the layers you think they are. A child object can carry a different layer from the root, and imported prefabs can preserve layer assignments you forgot about.

2. Inspect the Physics Layer Collision Matrix

Unity uses the project Physics Layer Collision Matrix as the default rule for which layer pairs can contact each other. If the pair is disabled there, normal collision and trigger interactions for those layers will not occur.

3. Check runtime IgnoreLayerCollision calls

Physics.IgnoreLayerCollision can disable all collisions between two layers at runtime. Unity’s current API also notes that changing this setting can reset trigger state and produce OnTriggerExit / OnTriggerEnter messages.

4. Check per-collider include and exclude overrides

Unity 6 supports collider includeLayers and excludeLayers overrides in addition to the project matrix. An exclusion wins over an inclusion, so a single Collider can legitimately behave differently from other objects on the same layer.

5. Use a default-layer control test

Put two simple primitive colliders on known-interacting layers. If that works, restore your intended layers one at a time. This separates the layer policy from Rigidbody, mesh and callback problems.

Official Unity references

Based on current Unity 6 Collider, Collider.bounds and MeshCollider documentation plus Unity trigger-collider setup guidance. Project settings and later engine updates can change behaviour.

Related Unity collider answers

Unity Collider Troubleshooter →

Unity Mesh Collider Not Working: Convex, Rigidbody & Mesh Checks →

Unity Trigger Not Firing: Why OnTriggerEnter Does Nothing →

Unity Collision Not Detected: A Short Diagnostic Order →