UMG drag and drop, from world to hud

I’m making a top down where the player can find items on the 3D world.
The player can klicka and drag the item and pick it up. But dragging it and releasing it over a UMG widget (the backpack) seems to be a little tricky. I’m getting no mouse-button-up event at all from the widget. :frowning:

Any ideas?

Hmm. About the only thing I can think of is having an event for mouse button released in your player character AND separately using the events “On Mouse Enter” and “On Mouse Leave” in your widget.

What I’m imagining is that using the two events in your widget, you could set a bool for “IsMouseOverWidget”. Then, when the player releases the mouse button, your player character can get the widget and check if the mouse cursor was over the widget. If it is, then that means the mouse button was released while over the widget, and you should be able to do some game logic based off of that.

I personally haven’t tried it, and I don’t know if it’s the best solution, but just my thoughts. Good luck!

Thanks for your answer. I tied it, but the “On Mouse Enter” doesn’t fire if you click the world and drag over the widget.

I ended up checking the position and size of the widget and compare that with the mouse position, to see if it is over the widget. At least this way, I got a response from the widget and I can probably work something out from there… :slight_smile: