Creating a Live system

Hello, im trying to create a live system with my current code. Basically when my character respawns i want it to take a life off and when it gets from 3 to 0 i want a game over screen to pop up and have an option to go back to main menu or retry. I know this is alot to explain without making a video of it. I know how to make the GUI textures i just dont know how to incorporate a script to correlate with my current one. Basically what i want to do is so when my player loses all 3 lives there will be a pop up menu asking if the player wants to try again or go back to the main menu. Any comments, scripts, or suggestions is very much appreciated. I already looked at tutorals ( the only 2 that i found ) and they already had script they were using and it didnt work for me.

Make a variable for your player lives.

Then, in update, check if your play lives is less than 1, meaning it’s zero. If it’s less than one, Destroy the game object. If you want a game over screen to appear, create a bool that declares when your GUI menu should be launched. When the player lives = 0, set it to true, and then it will pop up.

Check my signature for links to my tutorial series. I discuss this in my 9th video for the Space Shooter.

Best,

Jon