Repositioning a GUI Element

Repositioning a GUI Element

Jun 14 2019, 4:47 PM PST

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

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

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

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.

  • gui
  • script
  • coding