How to make smooth MouseLeave?

Hi,
So i made a thing where when your mouse hover over button it will show the name of what is this, but when i move my mouse very fast a gui didn’t disappearing.

Heres example because im bad at explaining:
https://gyazo.com/89bfcf64010e73476dd45fda47ba9b16

I use MouseEnter to show it. MouseLeave to destroy and MouseMove to change its position.

How can i fix this?

1 Like

Why destroy it and not hide it using transparency?

just tested it. the same problem

You could use this. Everytime the mouse moves it will get all GUI elements on the mouse. If there was no UI over the mouse, you could make that thing invisible.

Mouse.Move:Connect(function()
local GUIs = StarterGui:GetGuiObjectsAtPosition(Mouse.Position.X,Mouse.Position.Y36)
end)
2 Likes

Are you using any wait() functions in your code? Please send a snippet of the .MouseEnter and .MouseLeave functions so we can look into the issue a little more.

Seems like MouseLeave is a bit inconsistent. You can use MouseEnter and then constantly check the position of the mouse until it leaves the target area. I doubt this would be very resource intensive.

oh, i had a wait(). I removed it and now it works good!

1 Like