I'm making a Portal clone, and I have a code that is supposed to shoot only onto objects with certain layers. I start by defining the variable:
Later in the script when I incorporate raycasting:
I created two layers: "Shootable" and "Nonshootable." I put the layer "Shootable" on the objects I want to be able to shoot onto, and...
Raycast only shooting on certain layers?
Code (CSharp):
- public LayerMask canShootAt;
Code (CSharp):
- //The code that shoots the Portal
Raycast only shooting on certain layers?