I’m guessing this should be in Unity Answers but I just thought it would be better here. I want to ask the question: Does ScreenPointToRay need a Direction because Ray needs an origin and a direction but I’m sure I’m only defining the position here with ScreenPointToRay. I’m guessing it handles the direction automatically since the main camera can only be facing one way or something. Am I right or what do you know?
var ray : Ray = Camera.main.ScreenPointToRay(Vector3 (Screen.width * 0.5,
Screen.height * 0.5, 0));
Returns a ray going from camera through a screen point.
Resulting ray is in world space, starting on the near plane of the camera and going through position’s (x,y) pixel coordinates on the screen (position.z is ignored).