Context: I have a viewport frame (UIAspectRatioConstraint of 1) with the current camera’s FOV at 1, so that it’s as orthographic as possible.
If the part in the viewport frame is quite big, then I need the camera to be really far. If the part is really small, I need the camera to be quite close so that the part is visible. How do I create a script or formula that moves the camera back so that the part is entirely visible, with some margins? Thanks!