A guess, from the ScreenpointToRay docs: (position.z is ignored).
If you aren’t sure why that should be, read up more on what spToRay does.
Then, read up on rays. Origin and Direction mean what they say. Changing Origin (but not direction) by a few hundred pixels will look about the same. Then check how direction vectors work. (0,0,1) and (0,0,999) are the same direction.
[edit, response to comments]
There are several different things, which interact, but are still different:
o Vector3s are like floats. You can use a float to store seconds, or meters, or health … . Just because two things use a float, doesn’t mean they have anything in common. Vector3s are the same way. You have to keep straight which V3, and what does it mean.
o Rays are arrows in the game world. Origin is a spot in the world, in meters, the same numbers as when you place an object. Direction is unitless, like all direction Vectors. Both happen to be stored in Vector3s.
o MousePosition happens to use a Vector3 to store x and y pixels. It’s just boring old pixels. If your mouse is in the center of the screen, you can move the camera around all day, and mouseposition will always be (700,400)
o ScreenPointToRay looks at the camera in the game world. If you click on your camera, look at the small white square. SPtR takes the mousePosition, and does a ton of math, divides by pixels, … to figure where the mouse would be on that square. If your mouse is bottom center of the screen, it works out all the math to compute bottom center of that square. At that point pixels have been “cancelled out” and we’re done with them. SPtR figures the spot in world coords, which is the ray origin.
Then it draws a line from the camera, through that point. That’s the direction.
So mousePosition + camera position + camera facing determines ray origin, and direction. It’s always from the camera through somewhere on that small square (and goes out somewhere through that big rectangular cone.)