Search Issue Tracker
By Design
Votes
0
Found in
2019.1.0a12
Issue ID
1108901
Regression
No
SceneManager.GetSceneByBuildIndex returns a Scene that contains no information
Calling SceneManager.GetSceneByBuildIndex returns a Scene struct with no (or almost none) data.
To Reproduce:
1) Download the project and open any of the scenes
2) Enter playmode and look at the console
3) Note that the debug logs show the name of the active scene, but not that of scenes retrived from build settings
Regression checked to 2017.3 - appears to have always behaved this way.
---
Previously assumed this was limited to Scene.name - Doesn't appear to be the case. Therefore run the most recent repro project uploaded as it contains better logging.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [URP][Lighting] The skybox doesn't render after changing the settings of the Material when using the URP Render Pipeline
- Crash on ShaderLab::ShaderState::ApplyShaderState when entering Play Mode and calling ShaderWarmup.WarmupShaderFromCollection with a shader that has dynamic_branch
- Crash on operator delete[] when a serializable structure in the System namespace is serialized by a MonoBehaviour
- [macOS] forward and backward mouse buttons are recognized as middle mouse button
- NavMeshModifier.OnEnable/OnDisable gets progressively slower when called repeatedly
Resolution Note:
According to documentation ( https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.GetSceneByBuildIndex.html )
"This method [SceneManager.GetSceneByBuildIndex] will return a valid Scene if a Scene has been added to the build settings at the given build index AND the Scene is loaded. If it has not been loaded yet the SceneManager cannot return a valid Scene. "