Questions about change position of xr camera

Hello, i’m trying to use
xrHelper.setPositionOfCameraUsingContainer(new Vector3(a ,a ,a));
xrCamera.setTransformationFromNonVRCamera(camera);
after add these code my scene struck at (Loading assets… Please wait.) so can some one point me some example how to use
xrHelper.setPositionOfCameraUsingContainer(new Vector3(a ,a ,a));
xrCamera.setTransformationFromNonVRCamera(camera);
thank you

ps. i’m already trying to search about these code but what i got is only the code not the pg of these code.
mypg:
https://playground.babylonjs.com/pg/9K3MRA/revision/41

pinging XR master @RaananW

Hi Ershin,

(Correction edit)
not sure where you found the reference to the first function, but it is old and was removed from the API. You can control your camera jsut as you do with a regular camera. Doc is here - The WebXR Camera - Babylon.js Documentation

The second function is used to copy the transformative of a regular camera when entering XR and is called automatically when you start a session. Afterwards you can use position and rotationQuaternion to set the camera’s transforming

1 Like