This property determines a
GuiObject|GUI, which is relative to its absolute size. The origin point determines from where the element is positioned (through
GuiObject/Position) and from which the rendered
A good rule of thumb for this property: if the GUI in question is aligned to the left, the X value should be 0. If horizontally centered, set to 0.5. Finally, if the element is aligned to the right, the X value ought to be 1. Similarly, set the Y value to 0, 0.5, and 1 for top, middle, and bottom for Y alignment.
To understand how AnchorPoint works, try creating a
Frame/Position set to
DataType/UDim2|UDim2.new(0.5, 0, 0.5, 0) (this will set the Frame in the center of its parent object). If you were to change
Frame/Size, you would notice that the Frame will expand to the right and downward. The very center of the frame would also not be at the exact center of the parent object. However, if you were to set the AnchorPoint to
(0.5, 0.5), the Frame would expand in all directions and the center of the frame would indeed be at the parent object’s center.
This code sample moves a UI element to different sides of the parent element. It starts at the top-left and ends at the bottom-right. Paste into a LocalScript in a Frame, within a ScreenGui.