问题
I am willing to raycast specific layer and ignore other layers no matters its colider is above to my navPoint layer object?
int specificLayerMask = LayerMask.GetMask("NavPoint");//raycast only this layer ignore others
if (Physics.Raycast(raycastObject.transform.position, fwd, out objectHit, specificLayerMask))//50
{}
the above code raycasting to navpoint layer but unable to bypass other layers colliders. is there any way available to ignore all other collider and raycast to desired layer only no matter colliders are behind any other collider
来源:https://stackoverflow.com/questions/43558670/ignore-other-layers-collider-in-raycast