- Home /
How can I automatically resize a camera to fit its bounding image on a canvas on different aspect ratios?
Hi, I'm trying to create a minimap of a level, by using an ortographic camera with a large size. I have set up the camera to take up about three quarters of the screen width and height. This camera has an image behind it, to look as if the map was showing on a device. I have designed it to fit on a 16:9 aspect ratio, however, when changing the ratio, the image resizes (as it should) but the camera stays the same, resulting in the camera not fitting inside of it.
My question is, how would I go about resizing the camera so that it fits inside of its bounding image at different resolutions? I'm very new to Unity and quite confused by how the camera works with different resolutions, any help would be much appreciated!
This is 16:9 ratio (how I want it to look everywhere)
And this is 5:4 , as you can see, the camera is larger than the image, and its corners are visible