Quantcast
Channel: Latest Questions by AaronBrownLM
Viewing all articles
Browse latest Browse all 81

Is there a limit on the distance of raycast?

$
0
0
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?

Viewing all articles
Browse latest Browse all 81


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>