Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do I Make It Tween Into The Inside And Not Corner?

Asked by 3 years ago
Edited 3 years ago

Example : https://gyazo.com/0722f87c115ad0225038dc05e4a9bd5c

I cant seem to make it so when its tweening it only tweens into the inside and not into the corner, how do I prevent/fix this?

local object = script.Parent

wait(2)

object:TweenSize(UDim2.new(0, 0, 0, 0))

1 answer

Log in to vote
0
Answered by 3 years ago

You can use Anchorpoint for this. It allows you to set where the centerpoint of the gui object is. By default it's 0,0 (top left). If you set it to 0.5, 0.5 it will be in the middle. At that point you only have to downsize the GUI object and the position will stay the same.

Do note that you will have to apply additional offset to the position too to compensate for the anchorpoint.

Generally in order to keep something precisely centered. Anchorpoint: 0.5, 0.5 and Position: {0.5, 0}, {0.5, 0}

Ad

Answer this question