Repro: https://playground.babylonjs.com/#9K3MRA#2076
When you call scene.createDefaultXRExperienceAsync and the user device has hand tracking, the default hand models are not guaranteed to load into that same scene if more than one scene exists.
This is because the attach method of WebXRHandTracking uses EngineStore.LastCreatedScene
this._originalMesh = this._originalMesh || this.options.jointMeshes?.sourceMesh || CreateIcoSphere("jointParent", WebXRHandTracking._ICOSPHERE_PARAMS);
this._originalMesh.isVisible = false;
this._handResources.jointMeshes = WebXRHandTracking._GenerateTrackedJointMeshes(this.options, this._originalMesh);
}
this._handResources.handMeshes = this.options.handMeshes?.customMeshes || null;
this._handResources.rigMappings = this.options.handMeshes?.customRigMappings || null;
// If they didn't supply custom meshes and are not disabling the default meshes...
if (!this.options.handMeshes?.customMeshes && !this.options.handMeshes?.disableDefaultMeshes) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then
WebXRHandTracking._GenerateDefaultHandMeshesAsync(EngineStore.LastCreatedScene!, this._xrSessionManager, this.options).then((defaultHandMeshes) => {
this._handResources.handMeshes = defaultHandMeshes;
this._handResources.rigMappings = {
left: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("left"),
right: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("right"),
};
// Apply meshes to existing hands if already tracking.
this._trackingHands.left?.setHandMesh(this._handResources.handMeshes.left, this._handResources.rigMappings.left, this._xrSessionManager);
this._trackingHands.right?.setHandMesh(this._handResources.handMeshes.right, this._handResources.rigMappings.right, this._xrSessionManager);
this._handResources.handMeshes.left.scaling.setAll(this._xrSessionManager.worldScalingFactor);
Observed: the hand meshes are not visible; though general hand tracking interaction works normally
Expected: any effects of scene.createDefaultXRExperienceAsync would apply to that same scene