Button hovering doesn't work properly with widget animation.

I made a animation that buttons move,and the hover event was not triggered during and after the animation.

Also the click event didn’t work properly,it looked like the button was clicked,but the click event was not triggered.

I had to move the cursor out and hover again to make everything work properly.

This problem was pretty annoying.

And besides,this problem only occurs in packaged games.Everything works perfectly when I play in editor.

Here is my example:

I’m having the exact same issue. I am on 4.24.3. I’ll post here if I find a solution.

Yes,please. I still haven’t found a solution yet.

After reading through the code it seems that this is happening because when a button animates its position underneath the mouse and the mouse isn’t moving that doesn’t trigger the SButton::OnMouseEnter event. I ended up fixing this by modifying SButton::OnMouseButtonUp to consider a click on a button as valid even if the button isn’t currently considered to be hovered. This does mean that in this scenario where the button animates in it won’t hover until you move the mouse out and into its bounds, but for me this was acceptable.

Here is my fix, I just commented out the IsTouchEvent check so clicks are accepted as long as the mouse is over the button.

if ( !bEventOverButton/* && MouseEvent.IsTouchEvent() */)
{
	bEventOverButton = MyGeometry.IsUnderLocation(MouseEvent.GetScreenSpacePosition());
}

Thank you for the solution!
I actually found another way to fix the click event,but I still want the hover event to be fixed.
So I will leave this topic unsolved.

And my fix is changing the click method to “precise click”

1 Like

I think this fixed my issue thanks