Calculating offset to GameObject for CinemachineCameraOffset value

I’m trying to use CinemachineCameraOffset to apply an offset to my VirtualCamera so that a specific GameObject appears in the center of the screen.

The GameObject is guaranteed to be in the camera’s view, I just want to offset by x and y, so that it’s in the center. I’m having trouble figuring out what units of measurement I should be using.

(For other implementation reasons, I don’t want to use Cinemachine’s Follow/Body composers, just a simple Camera Offset.)

Any tips? Thanks.

The camera offset units are meters. Cinemachine isn’t going to give you anything here. You’re going to have to do the math, taking lens FOV, camera angle, and target distance into account.

OK, thanks.