Hi,
I was wondering if there was any way to get the Widgets that are contained in a UserWidget that is opened via a MenuAnchor from another UserWidget.
So say for example, I have a Main Menu and when i press a “Quit Game” Button, another Userwidget opens via MenuAnchor. In this new UserWidget there’s two Buttons with “yes” and “no”.
Now what I want is to have a reference to those two buttons in my Main Menu.
I’ve tried it via MenuAnchor->MenuClass->GetDefaultObject<UUserWidget>()->WidgetTree, but the Widgettree is empty, I guess because it’s a class reference and not an object reference?
I’ve also tried iterating through MenuAnchor->MenuClass->Children, which gives me the Buttons and all other widgets, however only as UFields, and I do not know how to cast them to UWidgets again, or get them as UWidgets.
Is there a “fix” to my two approaches? Or is there maybe a whole another way?
Help would be very much appreciated