# PickingInfo.hit never detects hits when the pointer is moving

**URL:** <https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305>\
**Category:** Questions\
**Created:** [July 10, 2023, 2:27pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305 "2023-07-10T14:27:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jozef\_Plata](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jozef_plata/32/30733_2.png) [@Jozef\_Plata](https://forum.babylonjs.com/u/Jozef_Plata)\
**Post date:** [July 10, 2023, 2:27pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/1 "2023-07-10T14:27:44Z")

</div>

Hi there,

So it seems that when the pointer moves, the `PickingInfo.hit` always resolves to `false`. This is a bit weird… or maybe it’s deisgned like that for optimisation?

But since `scene.onPointerMove` has `PickingInfo`, then I guess there is a way to use hit info on moving pointers? Can I configure it so I can detect hits with moving pointers?

Here’s an example showing, that on moved pointer `PickingInfo.hit` is always `false`:

> **[Babylon.js Playground](https://playground.babylonjs.com/#R8KSU6)**
>
> 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:** [July 10, 2023, 3:22pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/2 "2023-07-10T15:22:40Z")

</div>

I believe this is caused by the lazy picking feature, is there a way to turn it off @PolygonalSun ?

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [July 10, 2023, 3:28pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/3 "2023-07-10T15:28:24Z")

</div>

I’m literally having the almost same issue right now, but with Havok raycasting 🤔  
In this case, the raycast hits, but the result is not good, faulty body/transformNode and bodyIndex always 0.  
It worked perfectly good a few weeks back, so i am very confused

---

<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:** [July 10, 2023, 4:03pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/4 "2023-07-10T16:03:00Z")

</div>

Huh, that is strange indeed… do you have a playground example so I can take a look?

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [July 10, 2023, 4:19pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/5 "2023-07-10T16:19:47Z")

</div>

By default, picking on move events doesn’t occur unless one of the following is true:

- There is at least one ActionManager
- `enablePointerMoveEvents` is true for a given mesh
- `scene.constantlyUpdateMeshUnderPointer` is true

When none of the above are true, the PickingInfo will just provide the default information (which is just a miss). This was done effectively as an optimization as picking requires a bit more computing effort. If you’re looking to get proper picking info during a move, I’d recommend trying one of the above-mentioned methods and that should get you the info that you’re looking for.

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [July 10, 2023, 4:40pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/6 "2023-07-10T16:40:59Z")

</div>

@carolhmj  
Sorry, it’s a rather complex setup, when i made a PG sample i did not reproduce.

I kept digging and it turns out the ray started colliding with my character’s capsule body when moving the character or rotating the camera, i don’t know why, since the ray is offset to the right so it _shouldn’t_ cross paths with the capsule.

Adding filtering should fix it, i have procrastinated that for a while now.

---

<div class="post-metadata">

**Author:** ![Jozef\_Plata](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jozef_plata/32/30733_2.png) [@Jozef\_Plata](https://forum.babylonjs.com/u/Jozef_Plata)\
**Post date:** [July 10, 2023, 5:45pm UTC](https://forum.babylonjs.com/t/pickinginfo-hit-never-detects-hits-when-the-pointer-is-moving/42305/7 "2023-07-10T17:45:40Z")

</div>

thx @PolygonalSun😄
