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

Button tweening interrupted will stop?

Asked by
Prioxis 673 Moderation Voter
8 years ago

So when the player mouses over I make the buttons X change by 25 but if my mouse leaves before the button reaches destination it will bug out and I have to mess with it for it to return or fire the MouseLeave

script.Parent.MouseEnter:connect(function()
    script.Parent:TweenPosition(UDim2.new(0, 25, 0, 125), "InOut", .01, true)
end)

script.Parent.MouseLeave:connect(function()
    script.Parent:TweenPosition(UDim2.new(0, 0, 0, 125), "InOut", .01, true)
end)

If anyone knows why this happens please explain it to me because it's very annoying

0
I agree. I've had trouble with this as well. User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
script.Parent.MouseEnter:connect(function()
    script.Parent:TweenPosition(UDim2.new(0, 25, 0, 125), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .01, true)
end)

script.Parent.MouseLeave:connect(function()
    script.Parent:TweenPosition(UDim2.new(0, 0, 0, 125), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .01, true)
end)
Ad

Answer this question