Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Howcome my MouseLeave event isn't working?

frame.MouseLeave:connect(function()
	print("EXIT")
end)

So basically I got a script that does gui animation whenever the mouse leaves the frame. However 15% of the time, the event does not fire and the animation doesn't happen which leaves with a really annoying gui. If you know how to fix this or know of any better way to do a event when the players mouse leave a gui object please let me know. (Done in a local script)

1 answer

✓ Accepted answer
local Hovered = false 

frame.MouseEnter:connect(function()
	if not Hovered then 
		Hovered = true 
		print('Enter')
	end
end)

frame.MouseLeave:connect(function()
	if Hovered then 
		Hovered = false 
		print('Exit')
	end
end)

2 comments

0

See if this will work

0

Still doesn't work. The problem is that the MouseLeave event doesn't get fired 15% of the time for some reason and therefore can't perform the function within it which is print exit in this case. (Im doing more then that obviously)

This discussion is preserved as it was. New answers, comments, and votes are closed.