Switching between Studio Listeners using listener index


Hello, I am working on a game with multiple cameras. At each scene change the game jumping to another camera and I am trying to stick a listener on each camera and switch between these with the following script:

Switch to scene00:
FMODUnity.RuntimeManager.SetListenerLocation(0, null, null);

Switch to scene01:
FMODUnity.RuntimeManager.SetListenerLocation(1, null, null);

Switch to scene01:
FMODUnity.RuntimeManager.SetListenerLocation(2, null, null);

Unfortunately, it’s not so simple. Anyone has an idea how to solve this problem? Am I on the right track?


The total number of listeners isn’t updated until the first Update() of the RuntimeManager after a new listener is found.
You can use FMODUnity.RuntimeManager.StudioSystem.getNumListeners() to test this is the issue, and use setNumListeners before SetListenerLocation to ensure enough listeners have been allowed for.