# Getting WebXR camera position/rotation

**URL:** <https://forum.babylonjs.com/t/getting-webxr-camera-position-rotation/7404>\
**Category:** Questions\
**Created:** [December 5, 2019, 6:30pm UTC](https://forum.babylonjs.com/t/getting-webxr-camera-position-rotation/7404 "2019-12-05T18:30:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adammit](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@adammit](https://forum.babylonjs.com/u/adammit)\
**Post date:** [December 5, 2019, 6:30pm UTC](https://forum.babylonjs.com/t/getting-webxr-camera-position-rotation/7404/1 "2019-12-05T18:30:01Z")

</div>

In a normal non-XR scenario, I can get the camera’s current look direction like this:  
`camera.getForwardRay().direction`

I’m trying to do this in VR mode like this:  
`webXRDefaultExperience.baseExperience.camera.getForwardRay().direction`  
But this just returns (0, 0, 1) every frame.

Similarly, getting the position from this camera just gives (0, 0, 0) every frame, even though I’m moving the headset around.

Does anyone know how to get the VR camera’s current world space position/rotation? Is this a bug? Or am I missing something?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 5, 2019, 6:45pm UTC](https://forum.babylonjs.com/t/getting-webxr-camera-position-rotation/7404/2 "2019-12-05T18:45:25Z")

</div>

Hi,

the quick answer is - the camera is just a container for two more cameras (both eyes), which have in their position/rotation the eye position and rotation. combined with the container (which is their parent), they can deliver the global position of the camera.

This is, IMO, not very intuitive, that’s why I created this issue - [WebXR camera positioning API · Issue #7239 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/issues/7239) and will work on that very soon.

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [December 6, 2019, 9:08pm UTC](https://forum.babylonjs.com/t/getting-webxr-camera-position-rotation/7404/3 "2019-12-06T21:08:56Z")

</div>

@adammit! Welcome to the Babylon forum! So happy to see you here! Can’t wait to see what you create!
