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

**URL:** <https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154>\
**Category:** Questions\
**Created:** [March 4, 2022, 9:56am UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154 "2022-03-04T09:56:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![James1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/james1/32/20679_2.png) [@James1](https://forum.babylonjs.com/u/James1)\
**Post date:** [March 4, 2022, 9:56am UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/1 "2022-03-04T09:56:42Z")

</div>

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.

> **[Babylon.js Playground](https://playground.babylonjs.com/#9Z476P%2343)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

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.

Regards,

James

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 4, 2022, 2:49pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/2 "2022-03-04T14:49:10Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/0/2075fae8c38d609a5d436f838677b0c7d1e31570.png)

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 ?

---

<div class="post-metadata">

**Author:** ![James1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/james1/32/20679_2.png) [@James1](https://forum.babylonjs.com/u/James1)\
**Post date:** [March 4, 2022, 3:10pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/3 "2022-03-04T15:10:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![James1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/james1/32/20679_2.png) [@James1](https://forum.babylonjs.com/u/James1)\
**Post date:** [March 6, 2022, 9:07am UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/4 "2022-03-06T09:07:09Z")

</div>

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.

> **[Babylon.js Playground](https://playground.babylonjs.com/#9Z476P%2346)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [March 6, 2022, 4:43pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/5 "2022-03-06T16:43:04Z")

</div>

Here’s a quick example to use [edges rendering](https://doc.babylonjs.com/divingDeeper/mesh/edgeRenderer) instead of highlighting. 🙂

> **[Babylon.js Playground](https://playground.babylonjs.com/#9Z476P%2348)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![James1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/james1/32/20679_2.png) [@James1](https://forum.babylonjs.com/u/James1)\
**Post date:** [March 6, 2022, 4:58pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/6 "2022-03-06T16:58:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 5, 2022, 12:58pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/7 "2022-04-05T12:58:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![James1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/james1/32/20679_2.png) [@James1](https://forum.babylonjs.com/u/James1)\
**Post date:** [April 5, 2022, 3:02pm UTC](https://forum.babylonjs.com/t/multiple-meshes-highlighted-when-hovering-over-one-object-with-a-unique-name/28154/8 "2022-04-05T15:02:54Z")

</div>

Yes, this was perfect for what I needed thanks 🙂
