One problem with Ben's solution

One thing that isn’t addressed is that by disabling only the camera component rather than the entire camera, you still end up with multiple audio listeners. The simplest solution is to disable audio listener in the prefab and enable it the same as you do with the camera component.

There is another way, however. I had initially disabled the camera object, then used

GameObject camera = GetComponentInChildren(typeof(Camera), true).gameObject;

to find the camera component, and set “camera” to that game object. Then a simple

camera.SetActive(true);

activated the entire thing. This seemed to work fine, but I had changed mine to Ben’s because it’s simpler, so when I discovered the extra audio listener problem, I just disabled that component and enabled it when I enabled the camera component.

2 Likes

Privacy & Terms