# Cloned Source Is Null

**URL:** <https://forum.babylonjs.com/t/cloned-source-is-null/1271>\
**Category:** Bugs\
**Created:** [February 10, 2019, 11:07am UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271 "2019-02-10T11:07:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [February 10, 2019, 11:07am UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/1 "2019-02-10T11:07:39Z")

</div>

Yo @Deltakosh … Every few builds this bugs creeps back in there. I listed it a few times before in older forums. But the cloned mesh source property is null. It should be the source mesh that you cloned from.

Can you please look in that again 🙂

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 10, 2019, 2:04pm UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/2 "2019-02-10T14:04:27Z")

</div>

Please provide a repro in the PG because I cannot not reproduce the error

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [February 10, 2019, 2:41pm UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/3 "2019-02-10T14:41:05Z")

</div>

Same here, can’t repro.  
[https://playground.babylonjs.com/#UKNERM#70](https://playground.babylonjs.com/#UKNERM#70)

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [February 10, 2019, 7:09pm UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/5 "2019-02-10T19:09:45Z")

</div>

Yo @Deltakosh … Made A Playground

Sample Play ground using meshes from GLB:

Notice i am clone a mesh called: “Cube 1”

That has the null clone source… Check the console.log trace

But if i change clone “Cube” (another mesh in scene… that one clones just fine)

Really weird

Sample Playground:

[https://playground.babylonjs.com/#UKNERM#71](https://playground.babylonjs.com/#UKNERM#71)

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [February 11, 2019, 1:18pm UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/7 "2019-02-11T13:18:35Z")

</div>

Yo @Deltakosh and @bghgary … I figured it all out.

First of all the GLTF loader loads nodes as TransformNodes, Meshes or InstanceMeshes  
if it is an InstanceMesh it WONT have a source field. So cloned.source will be null or undefined. But it does have a sourceMesh field. So thats good to know.

Also… the GLTF support Mesh Instances (Exporting using the same GLTF Mesh ID). For prefabs (Designed to be used as a source for full deep cloning and create instances from)  
i simply ALWAYS generate a new GLTF Mesh ID… Again this is only for PREFABS… When are always DISABLED and used for DEEP CLONING.

Working Smooth, now that i know whats the what 🙂

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 11, 2019, 3:28pm UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/8 "2019-02-11T15:28:30Z")

</div>

Ok that’s good news!!!

---

<div class="post-metadata">

**Author:** ![Cornelius\_Huang](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cornelius_huang/32/4182_2.png) [@Cornelius\_Huang](https://forum.babylonjs.com/u/Cornelius_Huang)\
**Post date:** [September 24, 2019, 1:25am UTC](https://forum.babylonjs.com/t/cloned-source-is-null/1271/9 "2019-09-24T01:25:35Z")

</div>

Thank you! @MackeyK24 your answer helped me.
