I have two scenes in the Hierarchy when running the game. And this script attached to empty GameObject:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class LoadScenes : MonoBehaviour { // Use this for initialization void Start() { if (!SceneManager.GetSceneByName("The Space Station").IsValid()) { SceneManager.LoadScene(1, LoadSceneMode.Additive); StartCoroutine(WaitForSceneLoad(SceneManager.GetSceneByName("The Space Station"))); } } public IEnumerator WaitForSceneLoad(Scene scene) { while (!scene.isLoaded) { yield return null; } SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(1)); } } But it's taking like 3-4 seconds until it's getting to the line:
SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(1));