PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Change position of GUI element

Change position of GUI element

Jun 23 2018, 2:02 AM PST

Problem

You want to position a GUI 50 pixels down and 50 pixels to the right.

Solution

Use the UDim2|UDim2.new() method and set the offsets.

local frame = Instance.new("Frame")
frame.Position = UDim2.new(0, 50, 0, 50)

Discussion

We use UDim2 with 50 for both the xOffset and yOffset components. This will move the GUI down 50 pixels and right 50 pixels from the upper-left corner of the screen.

Tags:
  • gui