Collision layers
Related terms: layer mask, collision matrix
Labels that decide which objects can collide with which. Every collider is put on a layer, and a matrix says which pairs of layers interact. The player's own bullets ignore the player. Pickups react only to the player.
Ignored pairs are never tested, so this is also an optimization. A layer mask applies the same filter to a raycast: "only hit walls".
- Further reading
- Unity: Use the layer collision matrix to reduce overlaps