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
- Crash on AudioMixer::GetFMODChannelGroup when entering Play Mode in a specific project
- Prefabs with "Flags" enum properties result in "IndexOutOfRangeException" when trying to commit/revert
- The Camera first person mode in Cameras overlay is greyed out and not clickable when the Editor is restarted with the Game View focused
- Scene View doesn't select the Canvas when it's clicked with the View Tool
- Transform fields are impossible to edit when Inspector window is resized
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a13