How to scale game objects according to screen size
I know there are a lot of questions on this topic, I did a lot of tutorials and searched a lot for answers but none of them get the result I want. So this I why I ask this question here.
The game that I am making is targeted for mobile. So iOS and Android screen sizes.
The two images are an example of my game. I have a grey background, blue sidebars and a red object in the middle.
I want to scale the red object in a way the width and height are not cropped, they have to stay in perspective.
The blue sidebars are different. I want them to get the height of the screen, but then also scale the width in a way to not crop the image. This also should stay in perspective. So when I change the screen size I want this objects to scale according to the screen.
I hope you guys can help me on this. Anything is welcome. Answers here, answers to somewhere else, videos, etc.
Your answer
![](https://koobas.hobune.stream/wayback/20220612231703im_/https://answers.unity.com/themes/thub/images/avi.jpg)