Death screen and going to it after character HP hits 0?

I’m making my first game, trying to keep it simple. I know exactly what I’d like to achieve and what I have to do but I’m learning as I go along how exactly to do them. Right now I have a toggle flashlight, an enemy with simple AI and HP. When my HP reaches 0, nothing happens I’d like to load a death screen with a couple options for reload and exit. I’d also like to destroy the enemy after their HP reaches 0 as well. Currently, nothing happens. I have the enemy set to follow me and attack (diminish my HP). Any help is greatly appreciated.

Well, the first thing you gotta do is to create a scene that’ll be your death screen. To create a new scene you just need to go to File>New Scene or simply pressing Ctrl+N.


In this new Death Screen Scene, you must create two GUI Buttons, one to reload the game scene and the other to exit (check here how to deal with GUI Buttons).
After creating those buttons, you just need to add these two simple codes:

string gameScene = "Game";

    if (GUI.Button(new Rect(/* Configure the Rectangle as you wish */), "Reload")) {
    Application.Load(gameScene); // Or simply put the scene name as a string.
    if (GUI.Button(new Rect(/* Configure the Rectangle as you wish */), "Exit")) {

To go to this Death Screen Scene, you just add this to your character:

if (Character_HP <= 0) {

Now, to destroy the enemies which HP reached 0 you just add this to the enemies script:

if (Enemy_HP <= 0) {

It’s a fairly simple thing to do. You just need to detect whether the player’s health is equal or lower than 0, turn off some of the players’ scripts to prevent them from moving or shooting or performing any actions and then draw some GUI elements.

 var isNotDead:boolean=true;
    var showGameOverScreenLboolean=false;
    function Update(){
    // other things that you don't want the player to do while dead here
    function KillPlayer(){
    GetComponent(CharacterController).enabled=false; //makes the player unable to move
    //Other things here
    function OnGUI(){
    //GUI code with whatever you want to have at the death screen.