Issues with Drag and Drop Operation Affecting "On Mouse Enter" Events and Mouse Location

Hello everyone,
I’m facing a challenge in my Unreal Engine project related to a drag and drop operation for controlling cards in my game. While the drag and drop functionality works perfectly for managing the cards in my hand, I’m encountering issues when these cards need to interact with actors in my world. Specifically:
1. “On Mouse Enter” Events Not Triggering: When the drag and drop operation is active, the “On Mouse Enter” events for my actors do not trigger.
2. Incorrect Mouse Location: The mouse location on the screen does not update correctly during the drag and drop operation.
These two are likely connected as Interestingly, when I use my enhanced input mapping action to scroll-in (even if the rest of the function is disconnected), the mouse position updates correctly once for, and an “On Mouse Enter” event is triggered at the mouse’s location when the scroll-in event occurs. The location the mouse location was updated to when I would scroll is then kept and if I would rotate the camera and have that locations pan over other actors their “on Mouse Enter” event would trigger.
What I’ve Tried:
• Setting Mouse Positions to the Pointer Event: I attempted to set the mouse positions to the pointer event from the drag and drop operation, but this resulted in very erratic and hard-to-control mouse movements.

Some Video demonstrations:
When not dragging a card the mouse over event fires and the tiles raise a little when the mouse is over them and lowers when it leaves:

When the card is dragged the mouse over events are not fired:

But if I scroll in it correctly updates the mouse location to my actual mouse location (In the video i have the input action connected to a timeline that reduces the length of the spring arm on the camera. This works if there is nothing connected to the scroll event):

If I scroll in once to update the mouse location and then rotate the camera around the mouse location that was updated remains in place and it triggers mouse over events as if the mouse is still in that locaiton:

What I’m Looking For:
• A method to constantly update the mouse position to the correct location while the drag and drop operation is active without impacting controlling the mouse.
• Alternatively, a way to have the drag and drop operation not consume the input events, allowing the “On Mouse Enter” events to trigger as expected.
Has anyone encountered similar issues or have any suggestions on how to resolve this? Any help would be greatly appreciated!
Thank you in advance for your assistance.

I’d suggest not using drag and drop operation on your following card in this case.

  1. Instead use MouseButtonDown to start “Drag” and MouseButtonUp to “Drop.” Toggling a bool isMoving.


    image

  2. Tick the widget to follow mouse position if true. Do interpolation if you want smooth follow. So that when holding your mouse button, the events do not get consumed.

  3. However this will still not trigger the OnMouseEnter though because your card widget is following your cursor. As long as your widget is under your cursor, widget gets prior.

  4. But it does allow your mouse position to be updated on your player controller. Now you need to manually detect the actors under your mouse.

Difference between Drag n Drop and MouseButtonDown/Up in my project.

Thanks for the reply, the only problem I have with swapping from a drag operation is that im counting on the drag events for my other card widgets for the user to organize their hand. I’ve had no luck attempting to swap out the “OnDragEnter” events with mouse enter and keeping track of a bool for “isDragging”.

The perfect solution would be to have drag events be overrideable on objects in my world but that doesnt seem possible. Barring that, undoing whatever the drag and drop operation does to the mouse location would be a work around. Atleast then I could use the “OnMouseEnter” event and check if a card is currently being dragged.

If I cant get any of those then I might have to do away with the ability to organize the hand and use the method you detailed which im thankful you gave step by step instructions!