How do I move a mesh and keep it normal to a camera

I have a spacecraft that is in orbit about a body. On the spacecraft I mounted a camera that moves as the spacecraft’s position and attitude change. I want to project a respective field of view for an instrument making measurements where the camera is looking. I created a procedural mesh (only 4 vertices for the moment) as a game object that represents the FOV. As the camera moves along the orbit I’m trying to have the mesh move with it normal to the camera and some distance away from the camera. Anyone have some thoughts on how to make this work? Or … have any thoughts on improving what I’m doing to make it work?

Thanks for any suggestions!!


Project a ray down the 4 corners of your camera screen. Add a fifth vertex at the camera position. Convert all these values to the camera’s local transform space and then make the generated mesh parented to the camera. As it moves it’ll nicely update the mesh position for you. If the camera’s fov changes, you’ll have to regenerate the mesh.