Hey guys,
when trying to change the scene from one to another getting this issue which I couldn’t understand, I’m adding snapshot of the issue and the xr init code as well… ps guide me through…
const createXRSession = async (props) => {
var xr =await scene.createDefaultXRExperienceAsync({
outputCanvasOptions: {
canvasOptions: {
framebufferScaleFactor: 100,
antialias: true,
}
}
});
var xrcamRoot = new TransformNode("XRCam", scene);
XRCam = xr.baseExperience.camera
xrHelper = await WebXRExperienceHelper.CreateAsync(scene);
if(xrHelper.state = WebXRState.NOT_IN_XR)
{
const sessionManager = await xrHelper.enterXRAsync("immersive-vr", "local-floor" );
}
xrcamRoot.scaling = new Vector3(1,1,1);
XRCam.parent = xrcamRoot;
xr.baseExperience.onStateChangedObservable.add((state)=>{
if(state === WebXRState.IN_XR){
XRCam.position.y = camera.target.y;
}
});
}```