Hi I'm attempting to create a HUD element that appears if the players target has left the screen,its fixed to the edges of the screen and helps inform the player which way to turn to get them in the view again. my game has full 3d movement so it has to work with all possible rotations. I've almost got it working I'm just having trouble with constructing the quaternion that allows me easy access to the values I need.

My current quaternion doesn't seam to take the roll into account correctly as so doesn't output the correct vector

```
Vector2 Offscreenindicator(Transform me,Transform target)
{
//Construct a Quaternion that has x and y euler angles relative to the players roll
Quaternion test = Quaternion.LookRotation(target.position-me.position,-me.up)*me.rotation;
//make those euler angles easily accessable
Vector3 temp = test.eulerAngles;
float pitch = temp.x;
float yaw = temp.y;
//calculate the horizontal FOV
float Hfov = (2* Mathf.Atan(Mathf.Tan((pc.cam.fieldOfView * Mathf.Deg2Rad)/2)*pc.cam.aspect))*Mathf.Rad2Deg;
//normalise the angles to a 180 to -180 system
if(pitch > 180)
pitch -= 360;
if(yaw > 180)
yaw -= 360;
//clamp the angles to the edges of the screen then normalise them to 0 to there feild of view
pitch = Mathf.Clamp(pitch,-pc.cam.fieldOfView/2,pc.cam.fieldOfView/2)+pc.cam.fieldOfView/2;
yaw = Mathf.Clamp(yaw,-Hfov/2,Hfov/2)+Hfov/2;
//compare with the feild of view to convert to a screen locaton
pitch = (pitch / pc.cam.fieldOfView)*(Screen.height);
yaw = (yaw/Hfov)*Screen.width;
//return a value that can be used with GUI Components
return new Vector2(yaw,pitch);
}
```