Drag and drop widgets

Hi!

I’ve created a HUD with ScrollBoxes in which there are dragable widgets.

When the drag is detected the widget is removed from parent and when drop is detected it appears on the mouse position.

The problem is when I drag another widget and drop it on the widget draged before. The currently draging disappears.
It’s because the “On Drop” operation is implemented in my HUD widget whereas my previously draged widget in not a HUD. It’s recognized as drop on the dragged widget.

Is there any way to avoid this problem?

Thanks

If you have more than 1 dragging widget i would suggest different “drag and drop operation” blueprints for each of them.
Just right click in the content browser - new blueprint class - unhide all classes und search for “drag and drop operation”. Create a custom one with your variables. In your case you´d need 2 different drag and drop operations here.

In the on drop function on your receiving widget do a cast to your first created drag and drop operation. If this is true handle your regular on drop code. if the cast fails, do another cast for your second created operation and set up the new on drop code here.

You just need to create them correctly on your “on drag detected” function.
Hope that helps