Is there a way to, using cinemachine, make sure that all the targets in Cinemachine Target Group fit into a small square on screen? I can use the framing size to reduce the size, but since the viewport is 16:9, it keeps that ratio, and I’m wondering if there is a tighter control I can apply in screen space.
Maybe this in combination with the ScreenX/Y and Framing Size settings will do the trick
Hmm, I was using horizontal and vertical. When I switched to vertical or horizontal, it worked only for the targets that are laid out horizontally or vertically (otherwise it would zoom in/out too much). What is the mechanism behind vertical/horizontal only framing mode?
Horizontal Only will ignore the vertical dimension, and Vertical Only will ignore the horizontal. Unfortunately there is no finer control in the Framing Transposer, and so the aspect ratio will be preserved by default.
One way you might do what you need is to use an intermediate group as a target. Put a single member in it and add a custom script that references the real group, which sets the member’s position to the real group’s center and and sets the radius to be the real group’s bounding radius (there’s an API call in CinemachineTargetGroup to get that). Then you can frame that sphere in a small box on the screen, using VerticalOnly.
Does that make sense?
I had to come back to this and actually resolve it. Gregoryl, how can I frame the sphere in a box afterwards? That’s the part I’m not sure I understand.
Use the standard Group Framing “vertical” option to frame the intermediate target. The size you set will define the onscreen size of the box into which the targets will be fit.
Got it. I had to use both vertical and horizontal together, otherwise it didn’t work for vertical viewports. I didn’t understand why framer didn’t already do this without the intermediate sphere, though.