Best way to show a button explanation pop-up after 1 second?

I want to create a popup text over any button in GUI to show the description of this button.
I know I can use Mouse.Enter for that.
However, I’d like to show this text, only 1 second after the mouse is over the button, like when the mouse is over a tab in Chrome, to avoid unnecessary popups when the mouse moves faster between many buttons.
What’s the best way to show a button explanation pop-up after 1 second?

--- .MouseEnter:Connect(function() 
wait(1) 
-- Do your stuff 

end)

You can use a variable and wait(1) for that. Use Mouse.Enter to set the variable to true, then wait 1 second and if the variable is still true then the popup will appear. Then, with Mouse.Leave change the variable to false. So this is how it would work:
Player enters the button -> Variable is set to true
Player leaves the button -> Variable is set to false
After the player enters the button, use wait(1) and if the variable is still true then the popup will show up.

1 Like

That might end in a bug if you think about it. If the players leaves the button, the popup will still appear as the wait(1) in Mouse.Enter will still be running.

1 Like

Then somehow add a debounce that actually works with it.