failed to save and load scene with build index (int)
Posted: Tue Apr 26, 2022 9:24 pm
hi i trier use ES3.save
and ES3.Load
I just want my game remember the current scene
so using build index I tried to save an Int "mycurrentLVL"
and load it in start like this
public void Start()
{
MyCurrentLvl = ES3.Load("myInt", defaultValue);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + MyCurrentLvl);
}
and my game try to load the last scene each time (regardless of the number of scene ) and try to load one more scene that dont exist (if I have 6 it will load 6 and try load 7 )
I hope be helped :/
and ES3.Load
I just want my game remember the current scene
so using build index I tried to save an Int "mycurrentLVL"
and load it in start like this
public void Start()
{
MyCurrentLvl = ES3.Load("myInt", defaultValue);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + MyCurrentLvl);
}
and my game try to load the last scene each time (regardless of the number of scene ) and try to load one more scene that dont exist (if I have 6 it will load 6 and try load 7 )
I hope be helped :/