Isometric camera that adapts to different sizes of mobile devices

Hello,
I am a beginner in Unity and I am trying to make an isometric mobile game. I created an empty object called CameraPivot and rotated it by 30 on the x axis and by 45 on the y axis, gave the main camera the Z position of -10, made it orthographic and a child of the camera pivot.

Now the issue is that I don’t know how to make my scene visible on mobile devices with different screen sizes. I have a 10x10 grid of cubes that is visible on the more rectangular devices like smartphones, but on more square-ish devices like tablets, the left and right edge isn’t visible.
I came upon a technique using Cinemachine’s targeted group camera where you add two objects, one on the left side of the area that you want to be seen and the other on the right side and they make sure that no matter the device dimensions, both objects are visible by adjusting the camera’s size.
But this didn’t work for me because it made the camera not follow the rotation of its pivot and when I try to adjust the main camera, Cinemachine camera or target group camera’s transform rotations it just snaps back to 0.

My question is if it is even possible to achieve my desired result using this method or is there a better way to achieve it?

Please show a picture of your CinemachineCamera’s inspector.

Here it is:

In the Procedural Components section of the CinemachineCamera:

  1. Change Rotation Control to “None” (you don’t want to be dynamically rotating the camera in an isometric setup)
  2. Change Position Control to “Position Composer”. This will keep the target framed without rotating the camera.

Then, set your CinemachineCamera’s rotation to the desired one. Cinemachine will no longer alter it because you have disabled procedural rotation.

image

1 Like

Thank you, now I am able to rotate the camera. But I still have one issue. The target group isn’t doing what I want it to. its not forcing the Cinemachine camera lens to adjust its size to fit both left and right game objects into view.

Please show the inspector for the CinemachineGroupFraming component

1 Like

The component was disabled, enabling it fixed the issue. Thank you!