Highlight Layer issues

I’m trying to add/remove a mesh to/from a highlight layer when it is clicked. The cubes work fine, as intended, but imported meshes do not work correctly. After doing some digging, selecting a child mesh appears to work partially, though still not as intended. How can I have the entire mesh be added to the highlight layer? Here is a PG:
Shift: Select/deselect multiple meshes
Ctrl: Selects the first child mesh of the object, or the main mesh if there is not one
Alt: Selects all child meshes, or the main mesh if there are none (this is close to what I want though not the correct way)

You need to add all the meshes part of the object you are trying to select. Can you take a screenshot of what does not work in the alt case ? just to help me understand the issue better ?

1 Like

The alt cause is visually correct, though does not select the main mesh (the container / parent). I’m trying to add the main mesh to the highlight layer, which doesn’t work. I need clicking on the space ship (without Ctrl or Alt) to highlight the whole mesh.

It’s because in the imported mesh case, the container doesn’t have any of the vertices, it’s the children that have it.

If you want to highlight all of the vertices, you’ll have to highlight all of the children: Highlight | Babylon.js Playground (babylonjs.com)


Hello just checking in if you’d like any more help on this issue @Vortex

1 Like

Sorry for the late reply - I don’t, thanks for asking. Now I’m working on pathfinding (A*).