Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.44f1
2021.3.18f1
2022.2.5f1
2023.1.0b2
Issue ID
UUM-26414
Regression
No
Crash on LoadSceneAsyncNameIndexInternal_Injected when entering Play Mode
How to reproduce:
# Open the user attached project
# Open the “GameExampleScene” scene
# Enter Play Mode
# Observe the crash
Reproducible with: 2020.3.44f1, 2021.3.18f1, 2022.2.5f1, 2023.1.0b2
Reproduced on: Windows 10 (Intel)
Note: Build and Run doesn’t crash
First lines of stack trace:
0x0000029b79f75d43 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManagerAPIInternal:LoadSceneAsyncNameIndexInternal_Injected (string,int,UnityEngine.SceneManagement.LoadSceneParameters&,bool)
0x0000029b79f75c53 (Mono JIT Code) UnityEngine.SceneManagement.SceneManagerAPIInternal:LoadSceneAsyncNameIndexInternal (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f75bd3 (Mono JIT Code) UnityEngine.SceneManagement.SceneManagerAPI:LoadSceneAsyncByNameOrIndex (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f75991 (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:LoadSceneAsyncNameIndexInternal (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f758a3 (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:LoadScene (int,UnityEngine.SceneManagement.LoadSceneParameters)
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
- [Android][iOS] The keyboard closes and re-opens when consecutive input fields are selected
- Complex Sub Graph connected to a Voronoi node is ignored when the shader gets applied as a Material
- Compute Shader property not set error when entering play mode with path tracing and PBR sky
- "WebGL Publish" detects WebGL module and allows building when it is installed without restarting the project
- Editor is non-responsive and flickers when multiple Water System instances are enabled
Resolution Note:
We could not reproduce the crash, but we could reproduce a hang on LoadScene() when entering Play Mode. This hang is caused by the following user code in the Update() function of Timer.cs:
void Update()
{
while (inPaused == false)
{
currentTime -= 1 * Time.deltaTime;
countdownText.text = currentTime.ToString("0");
if (currentTime <= 0)
{
currentTime = 0;
// Cuando llegue a 0 el timer pasamos a la siguiente escena
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
}
This code results in an infinite while-loop calling to SceneManager.LoadScene(). Removing the while-condition solves the hang.
Please note that Update() gets called every frame, so there is no need for a while-loop here. An if-condition is sufficient. To verify that your code does what you expect it to do, it can be useful to use log-messages throughout your code or attach a debugger to step through it.