I'm using this line of code:
if (!Physics.Raycast (Camera.main.ScreenPointToRay(Input.mousePosition), hit))
return;
And the purpose is to detect if the mouse cursor touched a mesh collider.
And it works just fine on the vast majority of objects. But when I tried it on a REALLY large sphere (the size of a small planet), the above line of code no longer works.
Is there a limit on the distance of either physics.raycast or Camera.main.ScreenPointToRay? And if so, is there a way to increase the distance?
↧