Hi, In my game when I used Respawn() I want it to obviously respawn the player, however I want it to save the amount of lives and score the player has when the level is reloaded. When the player does die it reloads the level but the live remain on 3.
public int lives = 3;
void Respawn()
{
lives -= 1;
DontDestroyOnLoad (gameObject);
Livestext (); //ignore
Application.LoadLevel(Application.loadedLevel);
}
As you can see I tried DontDestroyOnLoad but I still had the same results...
Thanks in advance.
↧