I need help with this tween position mouse hover thing

I want to make a hover gui thing so like if you hover your mouse over a button it gets bigger but if i take my mouse off in middle of tween it doesnt go back to original size pls help

script.Parent.MouseLeave:Connect(function()
	script.Parent:TweenPosition(UDim2.new(0.326, 0,0.516, 0))
	script.Parent:TweenSize(UDim2.new(0.347, 0,0.164, 0))
end)
	
	
script.Parent.MouseEnter:Connect(function()
	script.Parent:TweenPosition(UDim2.new(0.293, 0,0.494, 0))
	script.Parent:TweenSize(UDim2.new(0.413, 0,0.211, 0))
end)
1 Like

Seems like you need to set the override parameter to true or else it won’t get override by the other newly created tweening animation.

script.Parent.MouseLeave:Connect(function()
	script.Parent:TweenPosition(UDim2.new(0.326, 0,0.516, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .5, true)
	script.Parent:TweenSize(UDim2.new(0.347, 0,0.164, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .5, true)
end)
	
script.Parent.MouseEnter:Connect(function()
	script.Parent:TweenPosition(UDim2.new(0.293, 0,0.494, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .5, true)
	script.Parent:TweenSize(UDim2.new(0.413, 0,0.211, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, .5, true)
end)

8 Likes