# Setting material erases tileset colour?

**URL:** https://community.cesium.com/t/setting-material-erases-tileset-colour/19055
**Category:** Cesium for Unreal
**Created:** [June 14, 2022, 6:45am UTC](https://community.cesium.com/t/setting-material-erases-tileset-colour/19055 "2022-06-14T06:45:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander\_Drozdoff](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_drozdoff/32/9436_2.png) [@Alexander\_Drozdoff](https://community.cesium.com/u/Alexander_Drozdoff)
#### Post date: [June 14, 2022, 6:45am UTC](https://community.cesium.com/t/setting-material-erases-tileset-colour/19055/1 "2022-06-14T06:45:05Z")

</div>

Having weird issue here. When i set material on a tileset component from linetrace hit component, the material gets decolourised. And even though it’s the same exact material instance that is on my tileset during its creation.

 ![Capture2](https://global.discourse-cdn.com/cesium/original/2X/a/a7d7b3c6633bb1b78b6e2e23bcdec4946b138ae4.png)  
 ![Capture.PNG](https://global.discourse-cdn.com/cesium/original/2X/2/228b089e2375f1929ea8b48df270b15c03500ea3.jpeg)  
and after setting material:  
 ![Capture1.PNG](https://global.discourse-cdn.com/cesium/original/2X/8/8133ad25cc053dbcb2bede567dd46780530ec09b.jpeg)

Anyone knows what causes this? I don’t recall this happening when i tried this on the previous plugin version.

---

<div class="post-metadata">

### Author: ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)
#### Post date: [June 14, 2022, 10:59am UTC](https://community.cesium.com/t/setting-material-erases-tileset-colour/19055/2 "2022-06-14T10:59:27Z")

</div>

Hi @Alexander_Drozdoff,

The Cesium materials have a bunch of parameters, and these are populated on load from properties of the tile’s glTF model. If you set the material after the tile is loaded, these parameters will have their default values.

However, I think if you save the _actual material instance_ on the component (not the one on the Tileset!) and then restore it afterward, the parameters should come with it. Let me know if that’s not working.

For what it’s worth, I can’t think of any reason this would have been different in a prior version of Cesium for Unreal. But if you do confirm that is the case, let me know what version it works in and we can look at what changed to figure out why it’s happening.

Kevin

---

<div class="post-metadata">

### Author: ![Alexander\_Drozdoff](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_drozdoff/32/9436_2.png) [@Alexander\_Drozdoff](https://community.cesium.com/u/Alexander_Drozdoff)
#### Post date: [June 14, 2022, 11:49pm UTC](https://community.cesium.com/t/setting-material-erases-tileset-colour/19055/3 "2022-06-14T23:49:48Z")

</div>

That absolutely does work!

Thank you.
