MouseLeave sometimes doesn't fire, is there a workaround?

In my game, theres a selection screen with UI animations that enlarge buttons when you hover over them, and when you move your mouse they return to regular size.

In the image below, you can see clearly that the teacher button simply doesn’t return to a regular size which is presumably caused by .MouseLeave not firing.

Is there any workaround for this?

Hey! You should check this module out. :slight_smile:

I think the only workaround would be to simply check the Mouse’s coordinates

This would be somewhat harder.

Yeah, what you could do if .MouseLeave isn’t working for you is just make your own MouseEnter and MouseLeave. By probably using a for loop to loop through the buttons, you could check by having starting Absolute Positions and also Offsetted ones and checking if the Mouse’s X and Y coordinates are between those 4 coordinates. Basically creating your own MouseEnter and MouseLeave, Similarly to Dede_4242’s idea.

are you using GUI:TweenSize() ?

Don’t rely on this for mouse leave, because it depends on the user’s framerate.

That’s not true. What is your code?