# Mesh.clone() seems to break highlightLayer

**URL:** <https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80>\
**Category:** Questions\
**Created:** [December 9, 2018, 7:37am UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80 "2018-12-09T07:37:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zephos](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zephos/32/50_2.png) [@Zephos](https://forum.babylonjs.com/u/Zephos)\
**Post date:** [December 9, 2018, 7:37am UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80/1 "2018-12-09T07:37:04Z")

</div>

It seems the highlight on a mesh breaks when you clone it. Is this normal? Here is a PG with the problem: [https://www.babylonjs-playground.com/#1KUJ0A#157](https://www.babylonjs-playground.com/#1KUJ0A#157)

---

<div class="post-metadata">

**Author:** ![ssaket](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ssaket/32/39_2.png) [@ssaket](https://forum.babylonjs.com/u/ssaket)\
**Post date:** [December 9, 2018, 7:54am UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80/2 "2018-12-09T07:54:33Z")

</div>

It’s not breaking the parent mesh rather superimposing it, I tried changing it’s position and the HL is visible again, I guess, it is something to do with the render order? [https://www.babylonjs-playground.com/#1KUJ0A#158](https://www.babylonjs-playground.com/#1KUJ0A#158)

---

<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:** [December 9, 2018, 7:06pm UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80/3 "2018-12-09T19:06:16Z")

</div>

[https://www.babylonjs-playground.com/#1KUJ0A#161](https://www.babylonjs-playground.com/#1KUJ0A#161)

As you can see, the clone is occluding the highlighted mesh resulting in no highlights. Mesh are drawn in the order they appear in the scene.meshes array.

---

<div class="post-metadata">

**Author:** ![Zephos](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zephos/32/50_2.png) [@Zephos](https://forum.babylonjs.com/u/Zephos)\
**Post date:** [December 11, 2018, 3:14am UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80/4 "2018-12-11T03:14:25Z")

</div>

That makes sense. However, in the case I ran into this, I was cloning a mesh to calculate a new rotation using lookAt and then disposing the mesh, so I would never have thought to move the mesh or disable it in any way. In this update PG I dispose the mesh and the highlight is still hidden. Can you explain why? Thanks

[https://www.babylonjs-playground.com/#1KUJ0A#162](https://www.babylonjs-playground.com/#1KUJ0A#162)

---

<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:** [December 11, 2018, 4:32pm UTC](https://forum.babylonjs.com/t/mesh-clone-seems-to-break-highlightlayer/80/6 "2018-12-11T16:32:28Z")

</div>

Fix is in master: [Fix clone observables by sebavan · Pull Request #5625 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/5625)

It will be deployed soon, it came from observables being cloned.
