Is it possible to use a layer mask when I raycast like this?
I have tried using a number after a distance number and it breaks also I have used a LayerMask var but nothing works.
function Click () { var mousePosition : Vector3 = Input.mousePosition; var screenRay : Ray = Camera.main.ScreenPointToRay( mousePosition ); var hitInfo : RaycastHit;
if (Physics.Raycast( screenRay, hitInfo))
{
Comment
Your answer
Follow this Question
Related Questions
Raycast hitting layer explicitly told to ignore (and doesn't even have collider!) 1 Answer
RayCastHit 2d with layerMask not workin 0 Answers
See RayCast with layermask 0 Answers
How do Contact Filters work? 1 Answer
collider Ignore player Raycast but not player rigid body or enemy raycasts 0 Answers