Download

Where do the Main Menu, Pause Menu, etc belong in the UE4 class game play framework classes?

Hi all,

I think I’ve narrowed it down to either the PlayerController or the GameMode or the HUD class? All the tutorials I’ve seen just put it in the character class which is not what a professional game would do.

The PlayerController represents the player and their input so would the Pause Menu go there or in the HUD class during gameplay?

What class would add the menu to the viewport and would they hold on to a reference to it and create it once or constantly create/destroy it as it is displayed?

I just want to do this right.

Thank you for your time.

This depends more on how your own code is designed. In most cases there are self written menu systems independent from other gameplay classes. The most settings in menus doesn’t affect the gameplay. You can catch inputs from everywhere in your code this hasn’t anything to do with your player controller class. The HUD has direct influence to the player experience it’s the visual representation of the character stats so this hasn’t anything to do with the main or pause menu.
How a menu is designed depends on what the menu should do. I wouldn’t hold a reference to any sort of menu if I’m currently in “Gameplay mode” because I want every power of the system for gameplay not for any sort of menu which aren’t used yet but if I’m in “Menu mode” I would hold a reference to the previous menu for easier navigation like a double linked list maybe? Menus doesn’t store that much information in most cases so it should be easy to hold reference to previous or next menu sites.