Unity3d restart current scene

You must ask the scene manager to load the scene using LoadScene

if (Input.GetKeyDown(KeyCode.R))  
    SceneManager.LoadScene( SceneManager.GetActiveScene().buildIndex ) ;

You were just retrieving the build index of the current scene.

Also, about yourcompilling error, you have forgotten the semi-colon at the end of the line 😉

Leave a Comment