DontDestroyOnLoad doesn't work on child objects

I have a DontDestroy script attached to an audio source which is a child of the camera. When I restart the scene, the audio is still destroyed, but if I remove the gameobject from being a child, dontdestroy works.

So what I’ve gathered is that dontdestroyonload doesn’t work if the target gameobject is a child of another object, which is a problem because I need this audiosource to be a child. Is there any way I can get a child object to not be destroyed?

You would have to unparent it from the object it is parented to when switching scenes, and then re-parent it to the Camera.Main of the scene.

Or, you set the camera to DontDestroyOnLoad instead, and just have one camera in the first scene, and no cameras in the rest (or you could destroy those cameras on load). @OmegaFalcon