So I made a tween size script for my simple SurfaceGui animation. My question is how do I make the tween size function run for a specific time so I decide when the gui part will reach my prefered tween possition?
My code:
local Frame = script.Parent.Frame local StartButton = script.Parent.Frame.Start local GUIBar = script.Parent.Frame.ProgressBar function OnClicked() StartButton.TextScaled = true StartButton.Text = "In progress..." GUIBar.Size = UDim2.new (0, 0,0, 50) GUIBar:TweenSize(UDim2.new (0, 600,0, 50)) end StartButton.MouseButton1Click:connect(OnClicked)
What do I need to do here?
You just have to add some things after the Udim2
GUI:TweenPosition(UDim2.new(1, 0, 1, 0), "Out", "Quad", 3) The last 3 would be the time, the things before the 3 are neccesary! (you can change them though)
(This is the same for tweensize)
Click here for the wiki