Similar issue to WebXR Hand Tracking default meshes not visible because they are attached to wrong scene
If there are more than 1 scene in existence, the joint tracking icospheres can end up in the wrong one and then HandConstraintBehavior doesn’t update position. PG: https://playground.babylonjs.com/#9K3MRA#2078
Source:
* Will usually be called by the features manager.
*
* @returns true if successful.
*/
public override attach(): boolean {
if (!super.attach()) {
return false;
}
if (!this._handResources.jointMeshes) {
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(this._xrSessionManager, this.options).then((defaultHandMeshes) => {