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

Howcome my MouseLeave event isn't working?

Asked by 6 years ago
Edited 6 years ago
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

Log in to vote
1
Answered by 6 years ago
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)
0
See if this will work awesomeipod 607 — 6y
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) goldstorm950 65 — 6y
Ad

Answer this question