I made a short script that I wanted to draw a raycast towards the player ignoring anything but the layer “wall”.
The layer “wall” is in user layer 9. It was supposed to promp ‘hit’ when the raycast didnt hit any object with the layer “wall”. Sadly, it still stopped at every object even if there were others with a diff layer. I even tried int layerMask = ~(1<<9); but it promt hit no matter where I putted it.

I tried other similar topics and also copying some peoples codes for practice but somehow mine wont work

and i’m very new to layerMasks