Drop widget as a child of existing widget

Hi,

I was following the Unreal documentation to drag and drop widget in my viewport but I’m stuck with this problem:

When I drop my widget inside another widget, it creates a “new” viewport, and it’s not a child anymore.

This is the on drop function.

as you can see in the widget reflector, I want the wb_Victory inside the wb hud where it was before the drag&drop operation. I can’t find a solution.

Any help?

p.s. this does not work

Why are you removing the widget from its parent if it’s already inside wb_hud? Just leave it where it is. Remove all the RemoveFromParent and AddToViewport nodes and just move the widget to where it’s supposed to go.

Now, if the drag operation changes the parent during the dragging, then you’d need to store the original parent before it is changed so you can restore it during the OnDrop function. But you still wouldn’t call AddToViewport.

I was tryiing to recreate what I tried before doing the post and I forgot to leave those functions there, buy I already tried with this

The widget doesn’t move at all and go back to the original place, even if the position value is changing correctly and the widget reference is correct