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

How can I make my gui shrink to the middle?

Asked by 7 years ago

I want to make this so that it shrinks and stays in the middle. How can I do this? Here is what i have, but it shrinks to left top corner. Can you help me understand?

sb.SurfaceGui.container:TweenSizeAndPosition(UDim2.new(0,0,0,0), UDim2.new(0,0,0,0))
0
You're making the gui move to the cords 0, 0, 0, 0 which is in the top left corner. lol NotSpecialCharacters 0 — 7y

1 answer

Log in to vote
1
Answered by
Uglypoe 557 Donator Moderation Voter
7 years ago

If you want to use TweenSizeAndPosition(), you'll need to know what it's parameters are. You can easily find them on the Roblox wiki here.

Essentially, the first argument is a UDim2 value that designates what you want the size the end up as, and the second argument is a UDim2 value that designates where you want the frame's position to move to. Thus, you can do something like this:

sb.SurfaceGui.container:TweenSizeAndPosition(UDim2.new(0,0,0,0), UDim2.new(0.5,0,0.5,0))

to keep the GUIObject in the center of your screen and have it shrink into nothing.

Hope this helps! -Poe

Ad

Answer this question