Hi!
I did the game over scene appear by creating a new script called gameOver.cs, here’s the code:
public float gameOverInTime = 5;
void Update () {
gameOverInTime -= Time.deltaTime;
print (gameOverInTime);
if (gameOverInTime <= 0) {
LevelManager nextScene = FindObjectOfType<LevelManager> ();
nextScene.LoadNextScene ();
}
}
I did the countdown there and attached this script to the Player GameObject at scene 2.
I think this way is better because the way that was done in the lectures the LevelManagerScript is always doing an if statement each frame to see if it has to do some countdown, the way I did it it only does it if there’s a player playing!
I hope this helps someone 