- Home /
How to make Unity 2D UI and game fit all mobile screen resolutions?
I tried to stretch the UI but it would either be too big or too small. I had to manually adjust it for every different mobile resolution which is tedious. The game part is off because I also have to manually change the camera orthographic size and game sprites etc for each resolution to fit properly. I'm looking for a simpler way to adjust the UI and Game to any mobile resolution without retyping and adjusting code for each mobile screen resolution.
Use Anchors for all UI elements and if you have UI images use Preserve aspect
Answer by $$anonymous$$ · Feb 10, 2021 at 12:20 PM
Under the Canvas Scaler component there should be a section that says "UI Scale Mode" instead of "Constant Pixel Size" select "Scale With Screen Size" Hope this helps!