Hi,
With these changes, all listeners will have Doppler enabled:
Change the SetListenerLocation in RunTimeManger.cs:
public static void SetListenerLocation(int listenerIndex, GameObject gameObject, GameObject attenuationObject = null, Vector3 velocity = new Vector3())
{
if (attenuationObject)
{
Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform), RuntimeUtils.ToFMODVector(attenuationObject.transform.position));
}
else
{
Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, velocity));
}
}
Then add
private Vector3 lastFramePosition = Vector3.zero;
to StudioListner.cs and replace lines 99 - 137 in with:
private void Update()
{
var position = transform.position;
var velocity = Vector3.zero;
if (Time.deltaTime != 0)
{
velocity = (position - lastFramePosition) / Time.deltaTime;
velocity = Vector3.ClampMagnitude(velocity, 20.0f);
}
lastFramePosition = position;
if (ListenerNumber >= 0 && ListenerNumber < FMOD.CONSTANTS.MAX_LISTENERS)
{
SetListenerLocation(velocity);
}
}
private void SetListenerLocation(Vector3 velocity)
{
#if UNITY_PHYSICS_EXIST
if (rigidBody)
{
RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody, attenuationObject);
}
else
#endif
#if UNITY_PHYSICS2D_EXIST
if (rigidBody2D)
{
RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody2D, attenuationObject);
}
else
#endif
{
RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, attenuationObject, velocity);
}
}
Please note this is just a workaround and once there is an update with a fix I will post it here.