Prefab material and instanciated object materials

I have a prefab object with multiple materials. Every clone of this objects needs these materials. However, each clone will need to be able to set their materials differently given whatever state they me be in, independent of the others.

Currently, if I instantiate multiple clones of the same prefab, they share linked materials. If I change the material on one clone, all of the others also change their matierial. How do I set it up where, when one clone changes it’s material, the other clones do not?

Change renderer.material instead of .sharedMaterial. When you do that, it makes a new instance of the material for the object. Or you can create the material instances yourself, which is sometimes necessary, such as if you want to clean them up. (Because if you let Unity make the instances, there’s no easy way to refer to them.)

–Eric