I have a setup where an enemy prefab has a trigger box that is in front of it:
Box and enemy itself is in the Enemy Layer.
Now I want to project a raycast to the Player, which is in Player layer.
(!(enter image description here)(2))(2)
But the raycast only hits the box(another layer) and does not hit the player at all.
If I invert the layermask it logs the box as the hit.
How can I make the raycast penetrate through the other object, I think setting up a layer mask was supposed to do it, but it doesn’t work as I expected.
Also the box is a trigger:
Is it normal that the raycast be to stuck to other layers when cast via layermask?
Added the ignore trigger as a parameter but it didn’t help.
This still happens when I change the layer of the box.
All the debug rays project correctly and I double checked the layering of objects.