I'm using tweenservice to tween GUI frame sizes to become larger, and I want it to be like a box that expands from all directions instead of just expanding from the corner outwards. Is there any simple way to achieve this?
frame:TweenSize(UDim2.new(0, 400,0, 400), "Out", "Quad", 1)
You may be wondering..."But I did that. Well you forgot one of the neat features of Gui; AnchorPoints
!
Anchor points acts as the origin points of the gui. Usually for every Gui, the anchor point is set to 0, 0
which is the default point. This option allows you to change the origin point to something else. By setting the anchor point to 0.5, 0.5
, you are stating that the original point of the frame is the 0.5,0.5
thus, the above code starts from 0.5, 0.5
Go to your gui's properties. Set the AnchorPoint
to 0.5, 0.5