UMG Performance (with many Panels or Layers)

So long as you’re setting the visibility to collapsed, collapsed UI is more or less as efficient as removing it all together. Collapsed UI is not Pre-Passed, Arranged, Ticked or Painted. You will more than likely need to make some custom functions for each of the major screens that show and hide them, change visibility, but also trigger things like breaking all event hooks or reacquiring them, as you may not want to update the UI when it’s not visible.

Removing the UI and letting it be GC’ed works too - it’s just that you may have to worry about hitches if the UI is complex enough the first time it’s shown, but sometimes a hitch doesn’t matter. Like when you’re transitioning back to the main menu and leaving the game.

Most of the time, people create a layer manager widget (one widget to hold them all for a certain game state, e.g Pre Game, During Game), just so they can manage the layering in a sane way, and ensure things like the HUD is always below the in game menu…etc.