# CustomMaterial.clone() Not Currently Working

**URL:** <https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743>\
**Category:** Bugs\
**Tags:** material\
**Created:** [July 22, 2020, 3:21pm UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743 "2020-07-22T15:21:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpaceToast](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/spacetoast/32/648_2.png) [@SpaceToast](https://forum.babylonjs.com/u/SpaceToast)\
**Post date:** [July 22, 2020, 3:21pm UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743/1 "2020-07-22T15:21:23Z")

</div>

Hey crew,

It looks like CustomMaterial is probably inheriting StandardMaterial’s clone() function, which doesn’t include its custom shader bits and bobs.

Here’s a demo: [https://www.babylonjs-playground.com/#UXCB15#115](https://www.babylonjs-playground.com/#UXCB15#115)

Cheers,  
Matt

---

<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:** [July 22, 2020, 5:30pm UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743/2 "2020-07-22T17:30:36Z")

</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:** [July 23, 2020, 3:35am UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743/3 "2020-07-23T03:35:49Z")

</div>

hey i am on it  
[https://www.babylonjs-playground.com/#UXCB15#117](https://www.babylonjs-playground.com/#UXCB15#117)  
i try make PR

---

<div class="post-metadata">

**Author:** ![Frankie\_Ali](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/frankie_ali/32/15338_2.png) [@Frankie\_Ali](https://forum.babylonjs.com/u/Frankie_Ali)\
**Post date:** [March 31, 2022, 7:35pm UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743/4 "2022-03-31T19:35:17Z")

</div>

Was this ever fixed? I’m still seeing this issue in the latest version 5 release.  
The playground by @nasimiasl does seem to monkey patch the issue.

---

<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 1, 2022, 7:05am UTC](https://forum.babylonjs.com/t/custommaterial-clone-not-currently-working/12743/5 "2022-04-01T07:05:24Z")

</div>

hey @Frankie_Ali

the reason that not solved yet i cant find for time write complete way for clone all shader parts and detect new uniform and all etc shader stuff you most check on clone

so yes that is uncompleted task  
but the best way to make simple clone is the monkey way you see in the sample but that not mean that is work for any kind customization
