Hi. Help me solve the problem. I have an array of materials. I need to apply them to game objects.When I change the texture, all objects have the same textures
forEach((elem,i)=>{
var newEl = el.clone()
newEl.name = 'BoxTemplate'+ i
newEl.rigidbody.teleport(0,0,5)
this.app.root.addChild(newEl)
newEl.model.meshInstances[0].material.diffuseMap = this.app.textureItem[i]
newEl.model.meshInstances[0].material.update()
})
in this code, I change textures, and I also have materials