unity restart scene code example
Example 1: unity reset scene
//for unity c#
using UnityEngine.SceneManagement;
...
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Example 2: Unity c# how to restart the level
void RestartLevel() //Restarts the level
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
Example 3: how to rerun unity game in code
SceneManager.LoadScene( SceneManager.GetActiveScene().name );
Example 4: how to rerun unity game in code
using UnityEngine.SceneManagement;