Hello my controller XR with oculus can’t be accessed. I’m not usexrhelper but i migrate vr helper to xr helper. Here’s my code
var vrHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera:false, useXR: true});
vrHelper.enableInteractions();
vrHelper.enableTeleportation({floorMeshName: "ground"});
vrHelper.onAfterEnteringVRObservable.add(()=>{
if(scene.activeCamera === vrHelper.vrDeviceOrientationCamera){
BABYLON.FreeCameraDeviceOrientationInput.WaitForOrientationChangeAsync(1000).then(()=>{
// Successfully received sensor input
}).catch(()=>{
alert("Device orientation camera is being used but no sensor is found, prompt user to enable in safari settings");
})
}
});
vrHelper.onControllerMeshLoaded.add((webVRController)=>{
webVRController.onSecondaryButtonStateChangedObservable.add((stateObject)=>{
if(webVRController.hand==="left"){
if(stateObject.pressed === true){
if(stateObject.pressed === true){
gizmoManager.boundingBoxGizmoEnabled=true;
}else{
gizmoManager.attachToMesh(null);
}
}
}else{
if(stateObject.pressed === true){
if(stateObject.pressed === true){
if(stateObject.pressed === true){
gizmoManager.attachToMesh(null);
gizmoManager.boundingBoxGizmoEnabled=false;
}
}
}
}
});
});