Quantcast
Viewing all articles
Browse latest Browse all 115

Scene not restarting after player death

In my game I would like to restart the scene once my player loses his health, so far he dies and the particle effects show but the scene doesn't restart. Could someone show me what I am doing wrong, thank you! void Die() { Instantiate(playerDeath, transform.position, Quaternion.identity); Destroy(gameObject); } private void Update() { if (curHealth > maxHealth) { curHealth = maxHealth; } if (curHealth <= 0) { Die(); StartCoroutine(ReloadScene()); } } IEnumerator ReloadScene() { yield return new WaitForSeconds(1.5f); SceneManager.LoadScene("1"); }

Viewing all articles
Browse latest Browse all 115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>