- Home /
Setting up Canvas to scale correctly with different resolutions
HI All!
I am having trouble getting my Canvas and the assets contained in it to scale correctly based on different resolutions/screen sizes. Details
I am developing a 2D puzzle game. most of the assets live within the canvas, as they are interactive
Currently, my Canvas is set to "ScreenSpace - Camera" with the Reference Resolution 2560x1440 as my Samsung S7 Edge is what I am developing on.
Game will be an Android phone game, but I would still like it to scale depending on resolutions of different devices.
If i am developing the Game and looking at it in the Game tab under the same resolution, everything is great. However, If I switch to Free Aspect and start to shrink/open up the window, things start to move out of place. If I adjust them for Free Aspect then they are out of place when i switch back to the resolution I need.
So I have some questions to narrow down what my issue would be: A lot of the sprites / gameobjects I use are set as Children under empty game objects, Just to organize everything better.
Is that allowed in Unity? or is it a bad idea
If it is allowed, should they be anchored to the empty Game Object or to the Canvas?
I think part of my problem is that I am not anchoring things correctly. However, I have tried to anchor the gameobjects under the canvas to the closest edge of the Canvas or to the middle of the Canvas, and this has not been fully successful either time. I am not sure which one is the correct path.
So now, with these settings, if I were to build it as a Mac application (quicker for texting than building to Android) - With 2560 x 1440 resolution, it looks great - With lower resolution, ex. 1600 x 1200, things are out of place.
I am not sure what I am doing incorrectly. Any help in the right direction would be appreciated. I have read the unity literature and googled many tutorials and it seems like things should be working, but are not.
thanks for any help, MN
I see some things anchored to the center, while others anchor to the left or right edges of the parent canvas. You should learn about how the Anchors work for you.
The Canvas Sacler component is also indispensable if you want it to fit in a variety of resolutions.