- Home /
Question by
AmateurPrograming · Feb 04, 2021 at 02:12 PM ·
respawnload scenereload
Reloading a Scene when I die doesn't work for the second level.
For some reason this works for the first level but not the second.
I am only using 3 lines of code to respawn the player.
public void Respawn()
{
Time.timeScale = 1.0f;
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex);
player.transform.position =
GameObject.FindGameObjectWithTag("SpawnPoint").transform.position;
}
Comment
$$anonymous$$aybe when it reloads the scene, it doesn't add the player into it because it wasn't there to begin with? The player (and camera) starts out in the first level. Then I move the player and camera to the next level.
Your answer
Follow this Question
Related Questions
Saving last checkpoint hit when reloading scene - Singletons? 1 Answer
Need help with my Respawn Script 1 Answer
help with death zone/respawn 1 Answer
Character Re-spawn Problem 0 Answers
Mulitple spawn points with random seed. 3 Answers