# Pointermove in immersive-vr

**URL:** <https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887>\
**Category:** Questions\
**Created:** [January 2, 2024, 12:16pm UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887 "2024-01-02T12:16:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mace\_blue](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@mace\_blue](https://forum.babylonjs.com/u/mace_blue)\
**Post date:** [January 2, 2024, 12:16pm UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887/1 "2024-01-02T12:16:15Z")

</div>

Hi there.  
How to implement pointermove in immersive-vr mode?  
I simple want to rotate the cube by press and hold a button and move the controller.  
It works with mouse. But when in AR it doesnt.  
Can someone help me with this question?

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#QARI8K%2313)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 2, 2024, 8:50pm UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887/2 "2024-01-02T20:50:46Z")

</div>

Hello, welcome abroad!  
The input in WebXR is all done through WebXRInput class, you can read more about it here: [WebXR Controllers Support | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRInputControllerSupport)

And here is a PG example using the `getWorldPointerRayToRef` from the class to detect the ray coming from the touch input: [Test XR Input with immersive AR | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#FB0PVC#10)

---

<div class="post-metadata">

**Author:** ![mace\_blue](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@mace\_blue](https://forum.babylonjs.com/u/mace_blue)\
**Post date:** [January 3, 2024, 9:25am UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887/3 "2024-01-03T09:25:06Z")

</div>

Thx for your reply!  
But I still don’t understand how to get the controller/pointer move information out of the getWorldPointerRayToRef. Is there an example where you press and hold a button on the controller, than drag it around in your livingroom without pointing on a mesh and some independent mesh reacts to the movement?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 3, 2024, 12:04pm UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887/4 "2024-01-03T12:04:26Z")

</div>

We have this example with controllers! [WebXR\_motion controller input | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#28EKWI#37)

---

<div class="post-metadata">

**Author:** ![mace\_blue](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@mace\_blue](https://forum.babylonjs.com/u/mace_blue)\
**Post date:** [January 4, 2024, 5:22pm UTC](https://forum.babylonjs.com/t/pointermove-in-immersive-vr/46887/5 "2024-01-04T17:22:39Z")

</div>

Thanks. It seems its not not possible because there is no canvas in the immersive-vr mode. So dragging ‘nothing’ makes no sense. Now I rotate that cube with the joysticks on the controller which works fine.
