How do I make my ui ratio the same for all devices

Just as the title says. I want to find a way to make my gui ratio the same for all devices without having to go to the properties and manually changing the scale and offset.

1 Like

You can use a UIAspectRatioConstraint in the root of your UI to keep the aspect ratio.

https://developer.roblox.com/en-us/api-reference/class/UIAspectRatioConstraint

This plugin is handy: [Plugin] Auto Scale for GUIs

1 Like

I think ive tried that before and it didnt seem to work when i put it in
is it gonna be something like this

ScreenGui
โ€“>frame
โ€”>UIAspectRatioConstraint
โ€”>The rest of the ui?

It should be more like this:

ScreenGui
--> Frame (Size: {{ 1, 0 }, { 1, 0 }})
----> UIAspectRatioConstraint
----> Rest of UI
1 Like

UIAspectRatioConstraint would do the trick, but I usually use scale.

Bear in mind the aspect ratio is a decimal. For a 16:9 ratio, your ratio would be (16 รท 9) = 1.777 (I believe).

You can use plugins which help you to change the UI ration. I use this one personally and it seems to work for me: https://www.roblox.com/library/1496745047/AutoScale-GUI