LoadedLevelName does not exit anymore in SceneManager

Hello guys,

I am trying to follow one tutorial that uses Application.loadedLevelName to restart the game after pausing it. However, this “loadedLevelName” doesn’t exist in SceneManager

I am trying to do it using this:

     public void RestartGame(){
     string sceneName = SceneManager.GetActiveScene().name;


But I receive the “cannot convert from void to string” error. But I am not sure how to fix this, because I am a complete newbie, so you guys have any idea? Thank you very much!!

Ok, so I finally found the answer. I was writting too much, the right code (In case someone is interested…) would be:

public void RestartGame(){

Thanks for reading! :slight_smile: