Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you value AspectRatio?

So I am trying to use AspectRatio on my GUI but it says the value is a float and I can't find any articles on the wiki other then the directed link to numbers which doesn't specify it...

--Variables
local StarterGui = script.Parent
local UI = Instance.new('UIAspectRatioConstraint')
local image = Instance.new('ImageLabel')

--Parents
image.Parent = screenGui
UI.Parent = image

--???
UI.AspectRatio = ?

for more understanding I'm trying to find out what a float is if anyone could help.

Edit: When I use Vector2 and a Integer that's positive it errors and says I need a positive value :/

thx, RoButCantBlox

1 answer

✓ Accepted answer

A float is simply a positive number with or without decimals.

UI.AspectRatio = 2 -- This should make your GUI twice as wide as a square.

If this helped, upvote/accept it! Thanks!

1 comment

0

thx, I'm surprised i didn't think of that... i thought it would be a X to Y ratio that's why i used Vector2 :)

This discussion is preserved as it was. New answers, comments, and votes are closed.