Found a very interesting bug in unity…
Let’s say you have a AudioSource attached as a child of a scene camera. But it is set with DontDestroyOnLoad, even though the parent camera is set to be destroyed. When a new scene is loaded, the audio source gets parented to the root. At that point, the AudioSource will be restarted.
So how can this be resolved?