Game over and pause menu conflict


Author: Aaronn Solomon

12/8/2023

The Problem

I had created a game over menu for when the player runs out of health. The issue that came was that the player could still pause the game after dying, which doesn't make sense. I tried using bools, instances of a new script, but nothing seemed to work.


The Solution

What I ended up doing is adding on to the check to see if the current scene is not the main menu. I added a check if the mech's health is greater than 0, and if it is, then you can pause. However, if the health is less than or equal to 0, then you can no longer pause. It was a much simpler solution than I thought, which was a nice surprise.