I am creating a new game but my game is not loading when I start my main scene.
private void Awake()
{
if (GameManager.instance != null)
{
Destroy(gameObject);
Debug.Log("Destroyed");
return;
}
instance = this;
SceneManager.sceneLoaded += LoadState;
DontDestroyOnLoad(gameObject);
}
This is not running when I start the Main Scene, the console shows, also the debug for LoadState is also not triggering.
Helps are appreciated.
I tried debugging, but the loadstate is not running.
The game is suppose to load the state right when the scene start, but I cannot seem to get it to work.
I am still really new to all this so please bare with me.
Ok, I figured it out and it was such a stupid mistake.
I simply had to go into Unity Editor Preferences and change the Editor settings so that it would load the scene when entering Play Mode. Not sure why this setting was off but it solved the problem I had.