Hamabama
Hamabama

Reputation: 253

How to change the color of material of an object individually if the material is shared

I have an array of 3d objects loaded from collada file. When I'm trying to change the color of material of an object from the array, color changes for all the objects in the array.

arr[5].material.color.setHex(0x00CC00); will update color for all objects in array. I assume it happens because the share one instance of material since objects are the same. Is there anyway to apply color individually? Thanks

Upvotes: 0

Views: 114

Answers (1)

mrdoob
mrdoob

Reputation: 19592

The way it works right now you need to have a different material per object. In the future maybe Object3D will have a color property.

Upvotes: 1

Related Questions