luarobloxluau

How can I make a GUI that increases in size equally on each side?



By example:

Thee initial position of the circle will be {0.5, 0}, {0.5, 0}

The final position of the circle will be {0.75, 0}, {0.75, 0}


The circle, won't "Twin (TweenService)" its size in one direction, instead, it will interpolate its size in each axis, maintaining its position on the center of the screen.


Solution

  • Simply set the AnchorPoint property to the middle of the object.

    circle.AnchorPoint = Vector2.new(0.5, 0.5)
    

    This changes where the object is positioned relative to its position.