Hey,
i’m nearly getting mad. I’m trying to get a simple drag and drop event to work on my Inventory for almost 6-8 hours now.
I created this all a year ago in the Canvas and needed to calculate all the position myself.
Now in UMG i thought Drag and Drop would help me create these inventories faster and easier, but it seems like DragAndDrop is
not working the way i thought.
My setup so far is/was:
Having one Widget called “Inventory” that has Slots for the Items. (Only displaying, because adding an item to a real slot and not the canvas completely
breaks the drag and drop, because it either doesn’t move at all or is limited to the parent widget slot).
One widget called Inventory Item, that shows the icon etc of an item.
Now, displaying this works perfectly, but as soon as i want to use drag and drop, it is a whole mess.
I looked through the examples on the forum and HUB, but no one is really explaining how this should work.
Capturing if my left mouse button was pressed is working. I tried to test if i’m hovering over a SLOT and, since the indices
of Slot and Item Array match, drag the Item Widget. Although that this works, i can’t move the widget as soon as my mouse overlaps
another item. The dragged item just stops. I doen’t matter what visibility settings the item widget has, as soon as my mouse overlaps
one of the other items, the dragged item won’t move until i leave the area again.
I don’t need to have the widget swap the places, i just need the slot which i’m releasingmy mouse button over. I will then just provide
my inventory function with the dragged slot number and the dropped slot number, but with the item not moving further, i think i’m doing
this wrong again. There are so many event for drag and drop and even something like “Create Drag and Drop bla”, i have no idea how to do
this.
I mean, there are marketplace projects where this is working in BP only, so it needs to work somehow, but i don’t get any idea on how to start
and how this whole thing should work.
Maybe someone can help me here getting started. For now i only need to able to drag an item and release it on another slot. Doing this should
give me the slot i am over.