I created a new Android 2D mobile project set to the following resolution:
In my scene, I have three 2D sprites and a camera as shown below:
As you can see, the sprites are not being rendered because they’re outside of the camera. I would like the camera to scale and fit to any screen resolution so all of the sprites will be rendered.
I was told there might be a way to do this with cinemachine, so that’s why I’m reposting my question here.
I know I can manually adjust the Position and Size fields of the camera so it covers the entire screen (Transform.Scale doesn’t seem to do anything):
but how can I do this through cinemachine or a script so that it accounts for all resolutions/aspect ratios?
I tried using the following solution (2d - Scale camera to fit screen size unity - Game Development Stack Exchange) but that didn’t work for me.