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

TweenService for GUI not working.What do i do in this case?

So this is my script but don't know why my TweenService doesn't work,and yes the frame is not at (0.262, 0,-0.65, 0). I also have an Play button that has the TweenService working for the frame but the GUI for the closebutton doesn't work.How do i resolve this?

local closebutton = script.Parent
local playbutton = script.Parent.Parent.Parent.PlayButton
local blureffect = game.Lighting.Blur

----------------------------------------------------------------------------

closebutton.MouseButton1Click:Connect(function()
	blureffect.Enabled = false
	playbutton.Visible = true
	local frame = script.Parent.Parent.Frame
	frame:TweenPosition(UDim2.new(0.262, 0,-0.65, 0))
end)

1 comment

0

We need more information to reproduce your problem. :/

1 answer

You need way more parameters for TweenPosition. TweenPosition requires not only the position but:

Most of those parameters are self explanatory. EasingDirection is which way the interpolation is aplied, ie inout is interpolation on the start and end of the tween. EasingStyle is the type of interpolation, ie exponential, when graphed, is a curve. Time is the duration of the tween in seconds. Override is whether the tween will override an in-progress tween. And lastly callback is a callback function to execute when the tween completes.

Ex.

frame:TweenPosition(UDim2.new(0.262, 0,-0.65, 0), Enum.EasingDirection.<chosen easingdirection>, Enum.EasingStyle.<chosen easingdirection>, <chosen time>)

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