Move camera back to fully see an object on viewport

Hey! Thanks for your answer.

That is actually one of the solutions that I mention at the end of my post: I know the size of the object and I know the size of the viewport so I can move the camera back as long as it extends beyond the frame.
But this doesn’t seem like a correct method to me since it uses a loop. I don’t think this is the method generally used in games when there is some sort of “zoom out focus” on an object…