Answers for "unity raycast all layers except one"

C#
1

unity raycast all layers except one

RaycastHit hit = Physics2D.Raycast(position, direction,
                  	range, ~(1 << LayerMask.NameToLayer("Player"))))
Posted by: Guest on June-07-2021
0

unity raycast all layers except one

RaycastHit hit; if (Physics.Raycast(muzzle[muzzleIndex].transform.position, muzzle[muzzleIndex].transform.forward, out hit, range, ~(1 << LayerMask.NameToLayer("Projectile"))))
Posted by: Guest on February-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language