InputEnded does not fire on GUI objects when the object moves in the context of UserInputType.MouseMovement

Example:

I have a button that tweens its color to a darker shade when you hover over the button, and then returns it to normal when it is ‘unhovered’. However, if the object moves position (or is hidden, see this feature request) while you are hovering over it, InputEnded will not fire.

Here’s what the button looks when you’re not hovering over it:
Screenshot_734

And here’s what it looks like when you are hovering over it:

Screenshot_733 Screenshot_736

The second image is when the button is being moved, but as you can see, no change to the color has been made, meaning InputEnded did not fire (yes, I’ve tested this with prints, color is just for visual representation).

3 Likes

InputEnded is unreliable currently. You can use this method made by madattak.
It does not work with surface guis. Using that module you could just add a script that would detect if the mouse is down or up. Mouse1Down, Mouse1Up and use this module to check if the mouse is in the GUI.

The module will need a small update to trigger it’s checking event when one of the Ui objects moves

InputEnded is not the same as the Mouse events - that’s why I use it. It’s reliable in every aspect the two bugs I have found so far.

Thanks for the module suggestion, it’ll probably help other people, although I won’t be using it since it only affects aesthetics and I want to keep the codebase as independent and simple as possible.