I have this piece of code for going to the next scene when the space pressed in built index order (for example , scene a is number 0 , scene b is number 1 and ... ) , but it doesn't work .
void Update () {
if (Input.GetKey (KeyCode.Space)) {
int nextSceneIndex = SceneManager.GetActiveScene ().buildIndex + 1;
SceneManager.LoadScene (nextSceneIndex);
}
}