Hello Friends,
I am working on a “2.5D” point n click adventure and before FMOD the unity listener was attached to the player character, so that the player could hear sounds that are near him. The listener rotation was LOCKED to camera rotation so that left/right works fine.
However, after adding FMODListener to the character prefab, FMOD’s StudioListener.cs seems to be setting the rotation of the listener, which is then being overridden by our custom script that locks rotation to camera.
This seems not-instant which is why a few bits out audio come out of the wrong speaker for just a few miliseconds.
I am wondering on how “to remove setRotation” from the FMOD Listener script, because rotation is being handled by our custom script.
I am no programmer, but looking at the code, I see:
private static void SetListenerLocation3D(int listenerIndex, Transform transform, Rigidbody rigidBody = null, GameObject attenuationObject = null)
{
if (attenuationObject)
{
Instance.studioSystem.setListenerAttributes(0, RuntimeUtils.To3DAttributes(transform, rigidBody), RuntimeUtils.ToFMODVector(attenuationObject.transform.position));
}
It uses full transform. I am wondering if I can somehow re-write this and remove rotation from transform…