2
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ The documentation is quite clear: ScreenPointToRay: Returns a ray going from camera through a screen point. ScreenToWorldPoint: Transforms 'position' from screen space into world space. \$\endgroup\$
    – Hellium
    Commented May 14, 2018 at 14:10
  • \$\begingroup\$ @Hellium Thank you so much for your response now I've got the meaning. \$\endgroup\$ Commented May 15, 2018 at 16:29

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .