# How to pull an object from far to close in WebXR with Joystick

**URL:** <https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141>\
**Category:** Questions\
**Tags:** webxr, mesh\
**Created:** [December 17, 2021, 10:25am UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141 "2021-12-17T10:25:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [December 17, 2021, 10:25am UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141/1 "2021-12-17T10:25:17Z")

</div>

[https://playground.babylonjs.com/#YEZPVT#968](https://playground.babylonjs.com/#YEZPVT#968)  
This demo works fine with mouse, and I want to achieve the same function in WebXR mode, in WebXR mode, I want to pull the sphere with Joystick, not mouse.

I just want to manipulate the distance to the ball, when change the distance to the ball, need keep the distance of the box constant.

I want to push or pull the sphere with the ‘xr-standard-thumbstick’ (as the following pic) of my vr glasses in WebXR mode,

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/d/0dca4437144138ec96943da005080d24ba441641.jpeg)

how could I modify the code?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 17, 2021, 1:57pm UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141/2 "2021-12-17T13:57:45Z")

</div>

@RaananW our XR guru is currently in vacation but will definitely have a look after the break.

Maybe @carolhmj knows where it is in the doc

---

<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:** [December 17, 2021, 6:05pm UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141/3 "2021-12-17T18:05:14Z")

</div>

Seems to be here [WebXR Controllers Support | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/divingDeeper/webXR/webXRInputControllerSupport) 😃

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [December 18, 2021, 2:44am UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141/4 "2021-12-18T02:44:14Z")

</div>

Thanks @carolhmj .

Yes, I have read this document. By reading this document again, I have a deeper understanding of it, but I am still not sure whether there is a direct configuration to achieve such a requirement:

The current situation is that I click the sphere and approach from the edge of the sphere to the center to narrow the distance of the sphere; and what I want is: point to the sphere, pressed the ‘xr-standard-trigger’ button, then pull the ‘xr-standard-thumbstick’ to change its yAxis to narrow the distance.

---

<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:** [January 4, 2022, 2:13pm UTC](https://forum.babylonjs.com/t/how-to-pull-an-object-from-far-to-close-in-webxr-with-joystick/26141/5 "2022-01-04T14:13:16Z")

</div>

You might find this demo interesting - [Babylon VR rythym | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#9M1I08#5) . This allows you to grab and place objects. what you will need to add yourself is the callback that listens to the axis change(s) and rotate the selected mesh. There is no standard implementation for this.
