This could be a beginner question but I am struggling since I started with unity. I am curious on how you guys approach this situation and how do big game companies do also. Thx!
it never look the same since all phones have different size
you can force it with black bars like you do with movies
but big companies make it dynamic, they use anchors and let it scale depending on the size of the phone, so that it looks good on all size, even if its different
^ ^ ^ This… this bigtime.
And here’s how to do it:
Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:
https://discussions.unity.com/t/845782/4
https://discussions.unity.com/t/848795/5
Usually you need to choose a suitable ScaleMode and MatchMode in the Canvas Scaler and stick with it 100%. Generally if you change those settings you will often need to redo your UI entirely.
I also use this CanvasScalerOrientationDriver
utility to make sharing UI for Landscape / Portrait easier. Read what it does carefully.
https://gist.github.com/kurtdekker/8802b1b6c708637398f8c9167641efd3
Thanks for your answer, but im not talking about UI, I am talking about actual sprites in the game, player, background, enemies and so on.
This is such a common question that I made a script to do it.
Full script to get at the corners of your screen: