Hello,
I have a problem. I created a Raycast.
RaycastHit hit; if (Physics.Raycast(muzzle[muzzleIndex].transform.position, muzzle[muzzleIndex].transform.forward, out hit, range, LayerMask.NameToLayer("Projectile")))
This Raycast is for a turret shooting projectiles, the raycast aims on the target. The Projectiles should not block the Raycast, so I assigned a layer to them. The problem is, that the raycast now ignores ALL layers, so it does not hit anything and the if-statement returns false. When I change one letter of the Layer (there is no layer with this name then), it works just fine, but of course it doesn’t ignore the projectiles. I tried everything I know, I use Debug.DrawLine, the Raycast is correct.
I have no idea what to do now