Hello!
I tried to use LayerMasks for my raycast and quickly realised it worked the opposite way than I needed it too. I need to exclude a layer but Layermask works the other way around. Is there a way to do this?
My current code is very simple:
RaycastHit hit;
LayerMask rayMask = 1 << LayerMask.NameToLayer("RootObject");
if (Physics.Raycast(startPosition, startDirection, out hit,Mathf.Infinity, rayMask)){
I simply want to Ignore the “RootObject” layer in my Raycast.
Thanks in advance.
- TwoTen