Hello.
I try to make a GUI button that increases it’s size every time the mouse hovers on it, and goes back to normal when the mouse is not hovering on it.
local object = script.Parent
script.Parent.Parent.MouseEnter:Connect(function()
object:TweenSize(UDim2.new(0, 130, 0, 130), nil, nil, 0.1)
object.Parent:TweenSize(UDim2.new(0, 158, 0, 149), nil, nil, 0.1)
end)
script.Parent.Parent.MouseLeave:Connect(function()
object:TweenSize(UDim2.new(0, 116, 0, 116), nil, nil, 0.1)
object.Parent:TweenSize(UDim2.new(0, 144, 0, 135), nil, nil, 0.1)
end)
But when the player hovers the mouse on the GUI button for less than a 0.1 second, the GUI is stuck as 130,130 and 158,149 until the player hovers again.