I finally got the chance to look into a bug I have seen since upgrading from babylonjs 5 beta 4 to the latest rc versions.
It seems that meshes with a skeleton that has needInitialSkinMatrix = true crash when cloned.
This seems to happen now because the Mesh constructor assigns the cloned mesh’s skeleton to the new clone by default and it didn’t do this previously (I’d actually like this to be optional, but that’s a separate matter).
This means that AbstractMesh.getPositionData is now called whereas it was not previously.
The line var skeletonMatrices = this.skeleton.getTransformMatrices(this); returns undefined as skeleton.prepare() does not calculate skeleton._transformMatrices if skeleton.needInitialSkinMatrix = true.
So AbstractMesh.getPositionData crashes when Matrix.FromFloat32ArrayToRefScaled is called as the passed in skeletonMatrices is undefined.
Hope this makes sense… its very late here.
Playground example of the crash (please open the debugger)