Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make my gui shrink to the middle?

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))

1 comment

0

You're making the gui move to the cords 0, 0, 0, 0 which is in the top left corner. lol

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.