Mesh picking on simplified mesh picks the wrong mesh

I’m trying to add interaction to an application where I have various complex mesh trees. The actual “entities” in my application are these mesh trees, all of which have a TransformNode
as a root, in which I stored a custom property with information about the entity itself.

When clicking on any mesh that is part of the entity, I want to traverse the tree back up to the root TransformNode for that entity, where then I can access the custom information to display it in the application.

The problem arises when using Auto-LOD with my imported GLTF models. The interaction picks the decimated models instead of the normal meshes, and those decimated models do not have the same root as the original ones, so I cannot traverse parent links to find my stored custom information.

The following playground shows the issue. At the top I added a flag do disable simplification, to show that without it it works.

It could be that there’s a bug with simplification of imported GLTF models, as I’ve seen that with another mesh (a .babylon file) my example works correctly:

You could disable picking for the LODs: https://playground.babylonjs.com/#WGZLGJ#9949

1 Like

The problem may be that meshes from glTF files are right handed.

See this answer (the overrideMaterialSideOrientation part):

It seems I misread your post! I think the solution from @Joe_Kerr is the right one.

1 Like

Thank you! This solved the issue.

This was another issue, it caused the normals of the LODs to be inverted, and I was already doing that