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

How can you tween a GUI? (or move it if im not using the right word)

Asked by
obcdino 113
8 years ago

I want to tween a GUI I'm using in my game, but I'm not sure if the following works, nor how to use it:

game.Players.RandomPlayer.PlayerGui.RandomGui.Label:TweenPosition(1,1,1)

I've seen people do things like that (cant remember the exact thing), so if I'm doing this wrong, someone please correct me?

1 answer

Log in to vote
3
Answered by
KordGamer 155
8 years ago

To Tween position or size, You must do this command

YourGUIObjectName:TweenPosition(UDim2.new(number, number, number, number), "EasingDirection", "EasingStyle", "Time")

UDim2.new() is where you want the GUI Object to slide to.

EasingDirection is either Going In ("In") or going out ("Out")

EasingStyle is the way it slides. Here is a link to a preview of all of them. http://wiki.roblox.com/index.php?title=API:Enum/EasingStyle

Time is the amount of time it takes.

0
Thanks for the details and links! Gave you 2+ Reputation :p obcdino 113 — 8y
0
Thanks! KordGamer 155 — 8y
0
Just a reminder, the only required argument is the first one, which defines the position. M39a9am3R 3210 — 8y
Ad

Answer this question