Normally, something like this is handled in one of the 3 ways, providing the goal is to show 1 widget at a time:
- you either have a manager blueprint who controls what, when and how stuff is displayed. You can even dispatch to a framework class in lieu of a dedicated manager - the
Player Controller
/Game Mode
may suffice. That BP would store references in order to hide current → show what is requested. - or you add widgets to single-child-container, the old widget should would pop-out atuomagically. Named slots work pretty well for this due to their versatility. I’d opt for that when working with non-component widgets and had some kind of Main UI.
- or you could have a single widget component in a class that can render (so not in the PC/GM),
Set Widget Class
dynamically and pipe in fresh data. This can be pretty efficient, especially when you extend theWidget Component
and let it handle the swapping logic internally. You could then reuse components like for other things where a modular interface is needed.
And I’d strongly recommend against Get All nodes. But that’s wishful thinking.