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

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

Asked by 3 years ago
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

Log in to vote
0
Answered by 3 years ago

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

Answer this question