Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2018.4
2019.4
2020.2
2020.2.1f1
2021.1
2021.2
Issue ID
1314527
Regression
No
AudioClip reference is lost when loading a new Scene even if AudioSource is set to DontDestroyOnLoad
Reproduction steps:
1. Open the user's attached project and Scenes/MenuScene scene
2. Enter the Play mode
3. Select Start Game in the Game view and listen to the Audio
Expected result: Audio is played even after loading a new scene
Actual result: Audio is lost after loading a new scene
Reproducible with: 2018.4.32f1, 2019.4.20f1, 2020.2.5f1, 2021.1.0b7, 2021.1.0a6
Note: Audio reference is not lost if the Script component that holds Audio Clip reference is open in the Inspector when loading a scene
Comments (1)
-
serdarwindows10
Mar 23, 2023 15:14
This still happens in 2021.3.2f1 if there are no references left to the clip (In our case it was the script that held the reference being destroyed), can be worked around by holding a reference to the clip in any script that won't be destroyed, simply using a coroutine works
private IEnumerator HoldHostage(AudioClip clip) {
yield return new WaitForSeconds(clip.length + 1.0f);
}
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
- Manual reference page for Grid Selection is missing
- Awaitable.NextFrameAsync causes GC Alloc 0.7 KB when using CancellationToken
- Prefab "Overrides" list item popups are overridden when navigating with keyboard arrow keys
- Alpha Tolerance setting does not affect generated outlines when generating Custom Physics Shape in the Sprite Editor
- The information/help message section misses a margin in the "Profiler" window
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a13