Test ray hit work,Sometimes not work

For example
https://www.babylonjs-playground.com/#HI65FJ#6
Ray hit not work,May be Bugs.I don’t know why.Someone who knows can help me. Thank you.
https://www.babylonjs-playground.com/#KNE0O#19
Ray hit work.

Hello this is because meshes with skeleton are aniamted on the GPU so CPU (who is doing the picking) has no idea where the mesh really is.

But you can fix it by calling mesh.refreshBoundingInfo(true):
https://www.babylonjs-playground.com/#HI65FJ#8

But beware in your example, you cannot change the scaling manually as it is already animated so your change will be overwritten by the animation

Thank you very much. Let me have a deeper understanding of Babylon.

1 Like