Hello, What I’m attempting is to make a raycast entirely ignore a certain layer. I’ve got this code here (so far)
The issue is this is doing the reverse of what I was looking for. it ignores ALL layers other then 8.
int layerMask = 1 << 8;
public Camera FPScam;
void Update () {
if (Input.GetKeyDown(KeyCode.Mouse0))
{
Shoot();
}
}
private void Shoot()
{
RaycastHit hit;
if (Physics.Raycast(FPScam.transform.position, FPScam.transform.forward, out hit, range, layerMask))
{
//Do Things
}
}