Respawn same place on restart

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

Respawn same place on restart

Post by hrohibil »

Hello Toni

In this script':

Code: Select all

  private void ReloadOnDeath(GameObject player)
    {
        if (SaveSystem.HasSavedGameInSlot(checkpointSaveSlot))
        {
            SaveSystem.LoadFromSlot(checkpointSaveSlot);
        }
        else
        {
            // Show load game menu? Go to main menu? etc. (Add your code)
        }
    }
}
How can i controll it to respawn at the first/staring point on death? Right now if he dies at the begining he respawns from a save game else where.

thanks
User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Respawn same place on restart

Post by Tony Li »

You can use some of Invector's original code for that method.
Post Reply