Why are my collision layers not working?
I'm working on some 2D stuff and I have a simple character sprite in the scene which has a Capsule Collider 2D, as well as a Ground object with a Box Collider 2D. I created a Layer called NPC for the character, and Ground for the ground object. Both objects have Dynamic rigidbody 2D components, and the ground object has a zero gravity scale, and all constraints boxes ticked (i.e. freeze position, freeze rotation).
In the layer collision matrix, the box for these two layers is ticked on, so I would think that the NPC object and Ground object would collide. However, this is not happening. When both objects are on the Default layer, collision works as expected. If I set the character to the NPC layer and the Ground to Default, there is no collision. But if I set the character to Default, and the Ground to Ground, collision again works as expected.
I'm stumped here. Why won't my custom layers collide with each other?