Use Layer Collision Matrix for Raycast

Hello everyone,

is there a way to get a layermask for a specific layer from the layer collision matrix? I want to use it with a raycast for my character controller.


Little late but I found this question searching for the same thing. You can use Physics2D.GetLayerCollisionMask(layer) if you’re using 2D physics, not sure what you can do for 3D.