Adjust Virtual Camera to fit Cinemachine Confiner Bounds for 2D

Hello,

Is it possible to dynamically adjust the virtual camera’s zoom (orthagonal size) to fit the area defined in Cinemachine Confiner bounds(2D)?

I am thinking that each bounds(collider) should have its own virtual camera where it’s orthagonal size is configured manually.

  • Entering the bounds, activates the virtual camera
  • Exiting the bounds deactivate the virtual camera.

Is my method of thinking correct or is there a more efficient method out there?

Hi,
Just to confirm my understanding, you’d like to create a level with rooms that have their own confiner + vcam. Depending on these rooms, some would have vcams that are zoomed in or out. When you enter a room, you active it’s confiner + vcam.

I like the idea. The way you describe it seems efficient.

Yes. I also want the vcam to be smaller than the confiner since I do not want to show the adjacent rooms.
But I do not want to adjust confiner dimensions and vcam’s orthagonal size separately.

So I create a script that takes the dimension of the room then calculate the confiner’s dimensions and vcam’s orthagonal size automatically.
6511803--733947--upload_2020-11-11_18-8-36.png

Thanks!