Inventory Slot problems

I have a simple inventory with drag and drop, almost working.

The thing I can’t fathom is: When dragging and dropping an object from one slot to another, when I drop the object onto a new slot how can I update the old slot (to show its now empty).

I have a grid panel of slots and I have a drag and drop operation.

The drop event happens on the destination slot I can’t call an update on the original slot from the destination slot !!

What am I doing wrong ??

W_Jones

You can create your own drag operation blueprint (in the content browser) and have it carry additional data - add any variables that you may need, in your case a previous parent reference perhaps.

You’ll have access to it when you drop:

[HR][/HR]
Alternatively, you can have the dragged widget itself carry that reference but that’s usually not the right way to do it.

Another alternative, for when things get complicated, you can have an entire new actor serve as Payload:


https://forums.unrealengine.com/core/image/gif;base64

Extending a drag operation is usually preferable and enough, and the most sensible thing to do.

edit: Nothing really stops you from plugging *the entire widget you’re dragging from *into the drag operation.