# Is there an easy way to get controller velocity / angular velocity?

**URL:** <https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698>\
**Category:** Questions\
**Created:** [April 25, 2022, 4:25pm UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698 "2022-04-25T16:25:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![owen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/owen/32/9325_2.png) [@owen](https://forum.babylonjs.com/u/owen)\
**Post date:** [April 25, 2022, 4:25pm UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/1 "2022-04-25T16:25:41Z")

</div>

Hi @RaananW,

I’m wondering if there is any pre-built method like getVelocity, getAngularVelocity from the hand controllers or do I need to calculate those myself frame by frame? I’m trying to implement a realistic “throw an object” experience in VR.

Thanks

---

<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:** [April 25, 2022, 5:20pm UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/2 "2022-04-25T17:20:45Z")

</div>

Hi owen, if you enable the physics module for the hands you can use the different impostors to get the velocity. It’s calculated by babylon itself (and doesn’t come from webxr) - [https://doc.babylonjs.com/divingDeeper/webXR/WebXRSelectedFeatures#hands-physics](https://doc.babylonjs.com/divingDeeper/webXR/WebXRSelectedFeatures#hands-physics)

---

<div class="post-metadata">

**Author:** ![owen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/owen/32/9325_2.png) [@owen](https://forum.babylonjs.com/u/owen)\
**Post date:** [April 26, 2022, 8:58pm UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/3 "2022-04-26T20:58:57Z")

</div>

Thanks. The link you sent me to is using HAND\_TRACKING:

```auto
featureManager.enableFeature(BABYLON.WebXRFeatureName.HAND_TRACKING, "latest", {
  xrInput: xrHelper.input,
  jointMeshes: {
    enablePhysics: true,
    physicsProps: {
      impostorType: PhysicsImpostor.BoxImpostor,
      friction: 0.5,
      restitution: 0.3,
    },
  },
});

```

But if I’m not using HAND\_TRACKING, should I be using PHYSICS\_CONTROLLERS instead? There seems to be no mention of PHYSICS\_CONTROLLERS on that documentation page anymore. Does HAND\_TRACKING replace it?

Also FYI, I just tried both of the Walking locomotion playgrounds on that page and both of them are broken with errors. Something about a missing mesh.

---

<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:** [April 27, 2022, 10:47am UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/4 "2022-04-27T10:47:26Z")

</div>

Oh, sorry, i didn’t notice you are talking about controllers and not hands. Yes, in this case you will need to enable the physics for the controllers and then use the impostors created there.

Ping @syntheticmagus regarding the demos, I’ll try checking them later as well

---

<div class="post-metadata">

**Author:** ![owen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/owen/32/9325_2.png) [@owen](https://forum.babylonjs.com/u/owen)\
**Post date:** [April 29, 2022, 10:07am UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/5 "2022-04-29T10:07:11Z")

</div>

I’m still having a bit of trouble finding access to the imposter. I have tried:

```auto
inputSource.onMotionControllerInitObservable.add(motionController => {
  motionController.rootMesh.physicsImpostor // appears to be undefined
})

```

Is there some other way to get to the physicsImposter?

---

<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:** [April 29, 2022, 10:30am UTC](https://forum.babylonjs.com/t/is-there-an-easy-way-to-get-controller-velocity-angular-velocity/29698/6 "2022-04-29T10:30:32Z")

</div>

You should be able to get the impostor using this function:

> **[WebXRControllerPhysics | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.webxrcontrollerphysics#getimpostorforcontroller)**
>
> Add physics impostor to your webxr controllers,including naive calculation of their linear and angular velocity \[API\]

it’s part of the physics feature. The input source is the controller itself
