Raycasting keeps getting blocked by objects on a layer it should be ignoring,Raycast blocked by layer it shouldnt be blocked by
// I've tried both options and neither do the job
layerTileMeta = LayerMask.GetMask("Tile Meta");
layerTileMeta = 1 << LayerMask.NameToLayer("Tile Meta");
if (Physics.Raycast(ray, out hit, layerTileMeta))
{
}
The layer Tile Meta should only be intractable with other objects in the Tile Meta. In the project settings, I've set it up that way, unchecking all boxes for Tile Meta except for the other Tile Meta. However, no matter what I put, my raycasts always gets blocked by an object not in the Tile Meta layer. This raycast is attached to an object on the Tile Meta layer, trying to send it to another Tile Meta layer object, and keeps getting blocked.
I've always hated layers. They never seem to work for me and I don't know why. Can anyone help? What am I not understanding right?
Your answer
Follow this Question
Related Questions
RayCastHit 2d with layerMask not workin 0 Answers
Ignore Raycast not working properly? 0 Answers
Raycast hitting layer explicitly told to ignore (and doesn't even have collider!) 1 Answer
How to Ignore Collisions Between a Layer and a LayerMask? 1 Answer
Can't change an object Layers at runtime via c# code (Help Please) 0 Answers