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

GUI tween is not doing anything (what have I missed?)

local Btn = script.Parent

script.Parent.MouseEnter:Connect(function()    
	    Btn:TweenPosition(UDim2.new(0.25, 0,0.073, 0))

script.Parent.Parent.MouseLeave:Connect(function()
    Btn:TweenPosition(UDim2.new(0.25, 0,0.082, 0))
	end

That is my code. I assume i missed something small that caused the whole thing to not work. The aim of the code is to make an image tween to a position while the mouse is on it, and to tween to the original position when the mouse leaves it. Any help is appreciated!

1 answer

Use all of the needed parameters for your Tween, which would be:

Btn:TweenPosition(UDim2.new(Position), --The goal positon.
Enum.EasingDirection.YourChoice, --Your EasingDirection
Enum.EasingStyle.YourChoice, --Your EasingStyle
X, --The duration of the Tween in seconds
true/false, -- Whether you want the Tween to interrupt other Tweens
function--  A function you want to call once the Tween is completed(This can also be ignored.)
)

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