Im making a game and Im at the point of making a gui but Im not really an expert so I been having this issue when making the GUI to fit all devices and I did used the UIAspectRatioConstraint but is not working as expected so I was wondering if someone can help me with this or at least to understand what is going on.
P.S.
I know how to get the AspectRatio, simply dividing X and Y after that just putting the first 4 numbers inside the UIAspectRationConstraint.
I think the problem itself may be the AspectRatio constraint that limits to you how much you can expand.
If you want the background to expand on all the screen make:
The size of the main frame of {1,0, 1,0} or the Scale for the X or Y axis of 1 so it covers the whole screen and you don’t need the AspectRatio constraint if you want the frame to cover the whole screen on all devices
Here is how to make Gui’s properly scaling on all devices and screen size.
Use the Scale for both Size and Position properties on all your Gui’s objects, Offset have to be to (0,0).
Use UiAspectRatioConstraint only for complex shape Ui’s or small Ui’s, such as each inventory slots, small icons, fully rounded (circle) frame using UiCorner ect… it is mostly to make UI’s keep their exact shape, and not being weirdly resized and expanded on the differents screen size, it is useless for huge frames that take or almost take the entire screen.
Use UiGridLayout and UiPadding, even if you don’t make a “grid” Ui, it is usefull to keep things at a certain position and size, such as keeping Ui’s to the left, right or center of another Ui.
Some things like UiStroke aren’t scaling properly over all screen size, so you have to check the screen size via a local script, and change the outline size of these depending of the screen size.
The mobile Ui is the most annoying one, as controls are on bottom left and right of the screen, so you will probably have to do 2 different Gui, one for Mobile and the other for Pc and console, then you can place Ui’s differently depending of the user device, and make visible the correct ScreenGui’s.