Maybe I can spread some light on this.
When I first tried to shoot people with the mouse (and presently) I ran a trace with two z values for the mouse position. One near the player and one far away. Once the trace has been run I convert the mouse position to world coordinates using the trace result (plus the closer z value) as the z coordinate. I gather the the template version uses camera.z which I thought should be the height coordinate of the camera... oye, anyway my version works perfectly.
On the terms "vector, coordinate, direction, and distance" I see them too often used interchangeably, even in technical writing.
AFAIK the actual definitions are as follows:
A vector is a relationship between two points in space, in terms of spacial coordinates (xyz).
A coordinate is the location of a point in space (xyz).
direction is the relationship of one point in space to another point, ignoring distance (pan,tilt,roll)
distance is the shortest path between two points in space, ignoring direction (called x in 3dgs, some other programs call it z).
Euler angles are easy to understand if you use your head. Pan is right/left rotation, tilt is up/down rotation, roll is cocking your head one way or the other.