I have a GUI Line (GUITexture) that stretches across the screen attached to my player object. I also have the main camera parented to my player object. In its default position (with the camera facing forward) the GUI line divides the screen in half at Screen.height/2. There is a script attached to my player object that will rotate the camera up and down (positive and negative around the x-axis).
What I would like to have happen is that, when the player rotates the camera down (so that the center of the screen is now pointing in a downward angle), the GUI line stays on the horizon (at y=0 in the player's space, but not the camera's), meaning that the line would seem to rise up the screen until it is no longer visible (when the down angle gets large enough). How would I determine efficiently (especially since this is a GUI function and will be called multiple times a frame) where the original y=0 line is on screen to find out how high on the screen the GUI line needs to be drawn. Every idea I have come up with so far either requires an empty object to be created or rather dodgy mathematics. There must be a simpler way!
Thanks for any help!