PickingInfo.hit never detects hits when the pointer is moving

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:

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

I’m literally having the almost same issue right now, but with Havok raycasting :thinking:
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

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

1 Like

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.

1 Like

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.

thx @PolygonalSun :smile: