Sound's custom attenuation function is not provided with distance from scene.audioListenerPositionProvider position


When using the custom attenuation function of a sound attached to a mesh, it seems like the distance calculated is always from the mesh to the scene’s active camera, even when the scene.audioListenerPositionProvider is set.

I’ve created an example here -

If the useCustomAttenuation property is set to false, or scene.audioListenerPositionProvider is not set, it works as expected.

I did not find any documentation that stated otherwise, so it seems to me like the distance provided to the custom attenuation function should also consider the audioListenerPositionProvider when it is set.

Please let me know what you think, thanks :slight_smile:

cc @docEdub

Sounds like a bug to me. Fixed in PR

Thanks for report this!