Raycast doesnt work on

Hi, maybe I found a bug.
The hitray seems to not be working when called just after being moved.
PG: https://www.babylonjs-playground.com/#TE2VBZ#1

Hello,
Use hitme.computeWorldMatrix(true); right before ray picking.
https://www.babylonjs-playground.com/#TE2VBZ#3
What happens is that mesh do not update its position right after it has been set.
It updates it right before render call.
Matrix of mesh is ‘dirty’. This helps to update only ‘dirty’ meshes that have been moved.
So there is more space for your processor if there are a lot of meshes are not moving in your scene.
I believe that if all of your meshes are move all the time it is possible to disable ‘dirty’ mechanism

1 Like

Yes, that’s it! Thanks :face_with_monocle: