C# Lower Math.Infinity

101 views Asked by At

how can I change the Mathf.Infinity to make the Raycast length be something like 0.1 Meters?

// Fire a ray through the scene at the mouse position and place the target where it hits
RaycastHit hit;
if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity, mask)) {
    newPosition = hit.point;
    positionFound = true;
}

Thanks for any help.

0

There are 0 answers