move to another scene unity 1

move to another scene unity

using UnityEngine.SceneManagement;
void Start(){
SceneManager.LoadScene(0/* the scene number*/);
}

Here is what the above code is Doing:
1. We are using the SceneManager class to load a scene.
2. We are using the LoadScene method to load a scene.
3. We are passing the scene number as a parameter to the LoadScene method.
4. The scene number is the index of the scene in the build settings.
5. The first scene is at index 0.
6. The second scene is at index 1.
7. The third scene is at index 2.
8. And so on.

Similar Posts