What is the difference between Unity's Camera.ScreenPointToRay
and Camera.ScreenToWorldPoint
. And where we can use these. I've watched some tutorial and documentation but I didn't get a clear understanding.
1 Answer
\$\begingroup\$
\$\endgroup\$
0
ScreenPointToRay returns a ray, basically something pointing in the direction of the mouse from the location of the camera.
ScreenToWorldPoint point actually returns a 3d position under the mouse.
Returns a ray going from camera through a screen point.
ScreenToWorldPoint:Transforms 'position' from screen space into world space.
\$\endgroup\$