Hello.
During gameplay I would like to move my camera so that an actor in the world is placed at a certain position relative to the screen.
For example, having the top edge of a square be at the top edge of the screen and the bottom edge of that square a few pixels above the bottom edge of the screen to be able to display text in the available space.
For the moment I manage to obtain that result but in a very laborious way: in loops I move back and lower my camera as long as “Project world to screen” indicates that the midpoints of the 2 edges are not close to the correct coordinates .
So it’s not precise and the camera movement is not smooth.
So I would like to know how to calculate in advance, before moving the camera, what its new position should be in order to be able to move it smoothly with a timeline for example.
I imagine there must be a connection between screen size, actor size and camera FOV but I can’t find it.
Thank you in advance for your help.