UMG Performance (with many Panels or Layers)

In our game we have an in-game HUD, a small menu to show at Game Over, a main menu, and some more. Is it better, performance-wise, to put all these things into one UMG asset, on different panels, and set only the currently needed panel to visible – or should I rather create different UMG widgets and load/display the one I currently need?

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.

Thank you very much, your explanations help a lot!

One more question: Did you really mean “collapsed”, or “invisble”?
Or what is the difference between those two, also performance-wise?