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

Tween Position Help! Please? :D

Asked by 9 years ago

I have this in a Local Script Inside a imageButton and nothing happenes :O

function onMouseEnter()
        TweenPosition(UDim2.new{0, 10},{0.5, 50},"Out", "Quad",1)
end
script.Parent.MouseEnter:connect(onMouseEnter)

function onMouseLeave()
        TweenPosition(UDim2.new{0, -90},{0.5, 50},"Out", "Quad",1)
end
script.Parent.MouseLeave:connect(onMouseEnter)


1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

The last line is being connected to the first function. Connect it to the second function by changing the text in the parentheses to "onMouseLeave". Also u need to connect the TweenPosition itself to the gui. The entire thing should look like this:

function onMouseEnter()
        script.Parent:TweenPosition(UDim2.new{0, 10},{0.5, 50},"Out", "Quad",1)
end
script.Parent.MouseEnter:connect(onMouseEnter)

function onMouseLeave()
        script.Parent:TweenPosition(UDim2.new{0, -90},{0.5, 50},"Out", "Quad",1)
end
script.Parent.MouseLeave:connect(onMouseLeave)

That should fix it...hope that helps.

Ad

Answer this question