Lecture Forgot to add gameObject.SetActive(false) in the Singleton

I don’t have a GameSession on my Main Menu Screen scene while I do have GameSessions for my other levels. So when I start the game from the Main Menu and go to my first level, the GameSession is loaded properly, but weird stuff happens when the player dies – the lives reset to the amount specified to the already-existing GameSession game object in the hierarchy. I just noticed that Rick forgot to add gameObject.SetActive(false) before destroying the GameSession which disables the pre-existing GameSession (from the hierarchy) from changing the actual amount of lives I should have.

Just thought of posting this here in case other people experience this problem of having deaths reset the player’s lives when going from one scene to another.

Privacy & Terms