I am new to Gui and I am making the buttons move out a bit when you hover over it with your mouse. Sometimes, when you take your mouse off of it, it does not detect it and the MouseLeave does not fire, leaving the button still extended outward. How can I fix this?
2 Likes
OnlyRoids
(OnlyStephen)
August 24, 2021, 12:12am
#2
Hey check out this post here it goes over how you can do it and it’s a simple module you’d implement into your game!
For a long time now, I’ve found MouseEnter and MouseLeave events to be rather unreliable. I’ve created a simple module to replace these for my new game, and thought I’d share it with you all in the hopes it would save some frustration and annoyance.
Does not support touch or game pads. Please report any bugs you find!
Note: Currently, once connected the events will continue to be fired until the GuiObject is destroyed, regardless of the UIs parent or visibility.
Note 2: Does not work for rota…
Actually, as you posted that I was trying this, it works too lol.
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…
1 Like