PIE: UWidget::RemoveFromParent() called on {widget} which has no UMG parent (if it was added directly to a native Slate widget via TakeWidget() then it must be removed explicitly rather than via RemoveFromParent())

I created Widget1 that has events and some variables than i created widget2 and went to File > ReparentWidget and than set widget1 so i can use events/functions/variables from that widget in the Widget2 now i can’t use RemoveFromParent only way i can remove the widget is with remove all widgets but i dont want to remove them all (no removing them all and than recreating them all isn’t and option) i tried making event RemoveWidget in Widget1 and calling it from Widget2 but it still isn’t removed

edit: i think the issue is caused by the fact that i use remove from parent than add to viewport and than every remove from parent i call after that no longer works

It’s good practice to store a reference of each widget as a variable or in a struct. You can then easily remove from parent, hide etc with a direct reference.