UI Drag & Drop

Hello.

I’m having an issue with my inventory system’s drag & drop function. I’m trying to drag items from the players’ inventory to a storage container inventory. The logic is working if I drop an item on top of another and swap that way, but dragging an item into the inventory as a new entry doesn’t seem to work.

The widget that contains item entries is a Vertical Box as a child of a Canvas Panel, the widget is set to “Is Focusable” and “Visible”.

I’m trying to achieve a vertical item list as the layout of the inventory contents, hence why I am using a vertical box instead of a conventional slot layout.

Am I missing something? Can a list view not be used for drag & drop operations?

Hello! I think your coding may be working but it may be something with the formatting of the widget. Is your vertical boxing resizing to the amount of entries inside it? I think since the box doesn’t extend any further you can’t add to the empty space inside the box and only can swap with the other entries. If that is the case I think making some sort of dropdown area to add in a new inventory that you drag the object to could work.

At least this is what I think is happening. I’m not entirely sure as your code seems fine and I haven’t seen your widget layout.

Hi BRGCooper,

Thank you. The vertical box doesn’t resize; it’s extended to the height of the canvas. I’ve added a picture showing the anchors.

Player Inventory Container Widget (Left side)

Storage Inventory Container Widget (Right Side)

When you try to hover over the blank space in the vertical box does the cast fail for the BP_DragDropOperation? Maybe place a print string there to find out in case it’s not recognizing it that way.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.