Friday, 2 November 2018

Game - Main Menu - Attempt #2

In my Unreal FPS game, I decided to approach the development of the main menu in an alternate scene. This is because I was experiencing some issues while changing the HUD and widgets within a single scene.

Why I changed the main menu system:
During the development of my game, I was encountering a bug. If the player died to an enemy, the game would show a 'Game Over' screen widget, and the player would need to press a button to re-spawn at the beginning of the game, as planned.

However, when the player restarted the game, it would display the Main Menu widget while also keeping the Game Over widget at the same time. I was unable to find a sufficient workaround, while keeping everything within one scene.


New Menu system:
For my new menu system, I have got three buttons and two labels. The buttons are used to load the game scene (OpenLevel, then Set Input Mode Game Only), open the instructions (Remove All Widgets Create Instructions Widget > Add to Viewport), or quit the game.


Blueprint code:



Conclusion:
I feel happier to have setup the main menu in an alternate scene, as I can keep it separate from the gameplay, and have to worry less about changing heads-up display (HUD) widgets between button clicks.

However, I am disappointed that I was unable to keep it to one scene, because it was suggested by my lecturers to try and keep this to one scene.