unity raycast all layers except one
RaycastHit hit = Physics2D.Raycast(position, direction,
range, ~(1 << LayerMask.NameToLayer("Player"))))
4.5
2
RaycastHit hit; if (Physics.Raycast(muzzle[muzzleIndex].transform.position, muzzle[muzzleIndex].transform.forward, out hit, range, ~(1 << LayerMask.NameToLayer("Projectile"))))
Thank you!
2
0
Are there any code examples left?
New code examples in category C#