camera.ScreenPointToRay always has same origin...

Hey, folks. Got a quick question here. Can you imagine any situation in which a ray’s origin is always the same, even though you’re using camera.ScreenPointToRay(Input.mousePosition)? I’ve been pouring over my code and can’t figure out why I’m not getting a ray.origin that’s different with the following code…

ray = this.gameObject.camera.ScreenPointToRay(screenPos);
print (ray.origin);
print (screenPos);

It is working as expected. The docs explicitly say “starting on the near plane of the camera”.

Note that the default Vector3.ToString() method rounds after the first decimal point, which could give you the wrong impression of the true values of vectors (this has been bugging me forever). Use this instead:

print (ray.origin.ToString("G3"));