void OnMouseDrag(){
ray = _main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 100, -gameObject.layer)){
target = _main.transform.InverseTransformPoint(hit.point);
}
I want to exclude every layer that is not the same as the script holder from raycasting, so I used -gameObject.layer but the raycast seems to not exclude any layer exceptthe default layers (default, ignoreRaycast and transparentFX).
All my custom layers are treated like one and no filtering is done with them even if they are not the same as the object calling the raycast, What’s wrong help!!