SizeConstraint Property Not Changing

I’m trying to change the “SizeConstraint” property of a frame from relativeXX to relativeYY using a local script during runtime. Using the command bar or the properties to change it works fine, but for some reason editing it in a script doesn’t actually change it.

This is all that is in my local script:

print(“Script Running”)
game:GetService(“StarterGui”):WaitForChild(“ScreenGui”).Frame.SizeConstraint = Enum.SizeConstraint.RelativeYY

The frame’s size constraint stays as RelativeXX.

FYI I’m using this in my GUI resizer to handle cases where the window’s aspect ratio changes so that the X to Y ratio exceeds 16:9 (Like a widescreen monitor). I could manually edit the size values every time the screen size changes, but it would be cleaner if I could just set the size constraints instead.

Help would be appreciated.

change the property of the frame in playergui not startergui

print("Script Running")
game:GetService("Players").LocalPlayer.PlayerGui:WaitForChild("ScreenGui").Frame.SizeConstraint = Enum.SizeConstraint.RelativeYY

Thanks, I forgot you had to do that :stuck_out_tongue:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.