Load Scene from intermediary Scene

This may be a basic question but I am unable to find any help on it anywhere,

For a VR project i’m working on the user must return to location (0,0) befroe the next level, so I have a intermediate scene for the user to move back to freely, then when ready press a button to load the next scene.

For this I need to be able to load the next scene, but do I need to have a separate intermediate level for each scene, e.g Scene 1 to 2, Scene 2 to 3?

Using a scriptable object:

  1. Create a script called SceneIndexObject.

  2. Add this code:

    using UnityEngine;
    [CreateAssetMenu(fileName = "SceneIndexObject")]
    public class SceneIndexObject : ScriptableObject
    	public int sceneIndex = 0;
  3. Go to your project, right click and select Create>SceneIndexObject

  4. Now, before going to the “level loading” scene save in the object you created the “scene index” of the next level to load, and when you press the button to go to the next level, just load the scene that is in the object you created. More detail:

  • Have the script with a reference to the object: public SceneIndexObject sceneIndexObj;

  • Drag the object you created to the inspector.

  • Access the “sceneIndex” variable and load that scene, also save the next scene in that variable.