Multiple meshes highlighted when hovering over one object with a unique name

Hi everyone.

I previously had an issue of having two meshes for each object so I changed the export to a Babylon file which baked the meshes into one object as you can see in this structure.

However, the issue I am having is the mesh is registering the name in the pick box but there are issues with highlighting. sometimes none are highlighted and sometimes two are highlighted when hovering over the buildings. Is there something I can change in the code to pick the mesh by name to avoid this strange issue.

I want to avoid cloning and deleting meshes where possible.



Unfortunately, this is impossible here cause the meshes are now drawn in the same draw calls:

You can see on the spector capture above 2 houses drawn in one call as they rely on instances. Highlighting unique instances is not supported by the underlying tech for highlights.

You could try edge rendering instead ?

Thanks for confirming.

I haven’t tried edge rendering, is that a similar code to the highlight one I have with a simple change? That may well work if so.

I’ve got it sorted with going back to the cloning method. I’m not sure how to render edges on hover but if someone could share some code in this playground that would be greatly appreciated. I’ll stick to the clone and highlight method if not.

Here’s a quick example to use edges rendering instead of highlighting. :slight_smile:

Thanks Blake, appreciate that. I’ll see how it looks on my bigger model :slight_smile: only one more issue to resolve and and then I’m at the finish line :tada:


Hey there @James1 just checking in, was your question answered? :smiley:

Yes, this was perfect for what I needed thanks :slight_smile:

1 Like