i’m adding a delegate to Scenemanager.sceneLoaded and try to load a scene, whoch works fine so far.
SceneManager.sceneLoaded += OnSceneLoaded;
SceneManager.LoadSceneAsync(name, LoadSceneMode.Additive);
but if i want to do something with the scene in the callback function, for example
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
Debug.Log(scene.GetRootGameObjects().Length);
}
it will throw an exception “ArgumentException: The scene is not loaded.”.
scene.isLoaded is in fact false at this point, as it gets set to true in the next frame i assume?
is this intended behaviour of the scene? i’d really like to do stuff with the scene when its loaded, it seems useless to have a sceneLoaded event when the scene is not marked as loaded.