Because colliders bake their Collision Filters from the Layer Collision Matrix, and queries also use a Collision Filter, unlike normal LayerMask-based physics queries, Unity Physics queries end up relying on the matrix.
See
, and the Layer Collision Matrix at the bottom.Both object's BelongsTo
and CollidesWith
must match to successfully interact.
This means that even when BelongsTo
is ~0u
(all bits enabled), the target's CollidesWith
must not be 0
. There must be a layer enabled in the Layer Collision Matrix.
This also means you can set a collider's CollidesWith
to 0
to deny queries from hitting it momentarily.
You can check the
or of the objects you expect to interact with, and validate that your collision filter matches. Note that the drawer may display 0-indexed layers, not the raw bitmask value.