Change the texture of material in runtime

Hi guys ,im facing this type of issue once i change the diffuse texture through code then it shows me an error

var material = this.playerSelectionGroup[index].playerClothColor;

Hi @Rimi and welcome!

My guess is that you use the render component instead of the model component.

Are you be able to share the error too?