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

Centering a Button in a GUI?

1 answer

✓ Accepted answer

The middle position would be UDim2.new(0.5, -size.X.Offset/2, 0.5, -size.Y.Offset/2).

size = size of object you are positioning, and not the parent GuiObject's size.

6 comments

0

Now its just positioned far to the right?

0

You should be subtracting the size of the object you're editing, and not the parent's

0

The size.X.Offset/2 and size.Y.Offset/2 should be negative

0

funny how I said subtract yet never actually did... Thank you @Fear

0

{0, 550},{0.5, 0} its positioned like this, and its right in the center.

0

It doesn't matter where the parent is positioned, you need to know the size of the object you want to center.. if the object is a direct descendant of a ScreenGui, all you need to to is set it to (0.5, 0, .05, 0)

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