Drag and Drop Operation Destroyed When Leaving Viewport

Hi, I’m working on an inventory system where the player can drag and drop the different inventory items to move them into their inventory. This uses the built-in drag-and-drop operation.

My issue is that if the player drags the widget off-screen, and then drops it, the widget is destroyed. Of course, this is expected behaviour because there is no widget outside of the UI to callback the On Drop event, however, I need to know when the widget is dropped, even if offscreen.

How can I know when the player drops the widget off-screen? Or how can I stop them from moving it offscreen?

Thanks.

SOLVED:

I just referenced my drag-drop operation and bound the On Drag Cancelled event.

It seems the On Drag Cancelled Event is called when it is dragged off screen.

1 Like

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