# Possible bug with cloning CustomMaterial

**URL:** <https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989>\
**Category:** Bugs\
**Created:** [April 14, 2020, 2:27pm UTC](https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989 "2020-04-14T14:27:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steff](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/steff/32/6866_2.png) [@Steff](https://forum.babylonjs.com/u/Steff)\
**Post date:** [April 14, 2020, 2:27pm UTC](https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989/1 "2020-04-14T14:27:20Z")

</div>

Hi! After cloning CustomMaterial through a .clone(), it is not possible to access the standard functions in the clone. Is this a bug, or am I doing it wrong? [https://www.babylonjs-playground.com/#UXCB15#109](https://www.babylonjs-playground.com/#UXCB15#109)

---

<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:** [April 14, 2020, 2:30pm UTC](https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989/2 "2020-04-14T14:30:11Z")

</div>

Pinging @nasimiasl

---

<div class="post-metadata">

**Author:** ![nasimiasl](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nasimiasl/32/34_2.png) [@nasimiasl](https://forum.babylonjs.com/u/nasimiasl)\
**Post date:** [April 17, 2020, 7:13pm UTC](https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989/4 "2020-04-17T19:13:39Z")

</div>

hi i work on it tomorrow sorry for late

---

<div class="post-metadata">

**Author:** ![nasimiasl](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nasimiasl/32/34_2.png) [@nasimiasl](https://forum.babylonjs.com/u/nasimiasl)\
**Post date:** [April 20, 2020, 3:28pm UTC](https://forum.babylonjs.com/t/possible-bug-with-cloning-custommaterial/9989/5 "2020-04-20T15:28:29Z")

</div>

hi

[https://www.babylonjs-playground.com/#UXCB15#111](https://www.babylonjs-playground.com/#UXCB15#111)

i notice when i Clone the CustomMaterial the Uniforms Array not serialized and that is empty  
is that way to make them work on serializehelper method?

line 46-47 ( i recreate uniform again )
