Attaching audio to a mesh seems to be broken in latest

This previously worked, but now even the canonical playground demo is broken. Here’s a slightly modified version of that demo which demonstrates the problem and a workaround.

The sound.attachToMesh() function is correctly hooking into afterWorldMatrixUpdate, but when the callback fires and invokes sound.setPosition() the new and current positions are always equal so the function returns without updating the soundPanner. It appears a this._position is a reference to the passed-in newPosition - maybe boundingInfo has changed?

1 Like

@RaananW can you have a look ?

Actually do not bother, I ll fix it :slight_smile: I have smthg similar.

PR is here the fix will be in the next nightly: Fix audio mesh by sebavan · Pull Request #11511 · BabylonJS/Babylon.js · GitHub

@dewing thanks a lot for the nice repro and investigation, it saved us a ton of time :slight_smile: