How to scale everything with screen size?

@karlkevin Dear community,

I’m developing a game for iOS and Android devices, but I have faced a big problem, what is scaling. I have almost completed my game and tested on iPhone 4S, and everything was beautiful, so I decided to test on iPhone SE, and evetything is not so beautiful anymore. I have made game with camera aspect ratio 2:3, but it still zooms in everything. The buttons are in place, because I have selected “scale with screen size”, so my question is is there any way to do the same “scale with screen size” to everything else- sprites, pictures etc. Or do you know even easier solution?

Thank you for your help! :slight_smile:


Hi there, the same for me. After looking around on the internet about 2 hours :(.
Watching a lot of tutorials video. Finally I found the full tutorial that solve this issue.
Tested and it worked for me.

Hoping that will help you.
Link: [SOLVED] Full tutorial: Build 2D game fit to any device screen size, resolution in Unity 2018 - YouTube

You can do this by using screen.dpi and scaling the objects according to it.

@karlkevin…did u resolve the issue? if so how? may i know ,i am also facing the same issue now on android i have developed the game on 16:9 aspect ratio.

You can also use script for particular objects to be inside viewport all the time. by using ViewportToWorldPoint
Check here

Check this link to make your screen fit for all screen resolutions in unity. It’s working unity version 2020.3.35f1

Credit for the creator