When trying to determine the vector along which either the player, the player character or a non-player unit is looking we run into a ahow-stopping problem. Namely, although we can easily find the corresponding x,z world co-ordinates, there is no way to return an useable y world co-ordinate for height, and, consequently, we have no way to reliably determine the POV pitch angle.
Observation of the y values returned by screenToWorld indicates that provided the position returned by the command is located upon the terrain itself everything is in order. When sampling any points above the landscape, however, screenToWorld returns values which cannot be used to calculate an accurate 3D POV vector. EyeDirection, OTOH, simply returns an approximately horizontal vector at all times (ie., 2D vector). Incidentally, vectorDir also does not work, although this is by design since it is meant to return the vector direction of the entire object model rather than head or gaze vector.
Currently, the best proxy for determining gaze pitch angle is weaponDirection, but this is problematic as a character has to be both armed and have a weapon raised in order for this command to serve our purposes. Perhaps something could be kludged together using selectionPosition on a character's head, but this would be a cumbersome workaround at best.
Would it be possible for both screenToWorld and eyeDirection to return y values that could then be used to compute an accurate 3D POV vector? Note, that screenToworld is not necessarily equivalent to eyeDirection as the former indicates where the player's camera is looking and the latter indicates where an in-game character model is looking. {F18378}