Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
david.ishii's avatar
david.ishii
Explorer
6 years ago

Changing Scenes with Unity 2019.3.0.

I have two scenes in my build. Scene 1, menu, and Scene 2, game. I have a simple SceneLoader script on a button in Scene 1 which should link it to Scene 2. 

using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{ public void LoadScene(int level)
{
SceneManager.LoadScene(level);
}
}

But, whenever I play Scene 1 in the editor, it automatically skips to Scene 2. Does anyone know why this is happening? Or a better way to change scenes?