I would like to modify an object’s material at runtime, however if there are any other objects using the same material then all those objects will be affected.
I am wondering if there is a way in unity to give an object an instance of a material, so that only that instance of the material will be modified?
Is there any way to do the opposite? As in having multiple multiple instances of the same material on some objects and you want to use one shared material on all of them.
– bboysil@bboysil You can assign a sharedMaterial to share it between multiple renderers. If you need each one to use the same texture (and material params), that's fairly easy. If they have different textures, you might look into a technique called "atlasing".
– rutterOh man, I don't care if this was in 2013, you are a god. Thank you so much. I've been having a lot of problems with this and you summed it up so nicely. Greatly appreciated!
– ahungrybearHi. I know the topic is pretty old, but i wonder: what about garbage collection of such new instances of materials? How efficiently Unity handle it? For example, Game Object is being enabled and disabled in cycles ("pooled" you could say), but each time some of the properties are randomly changed. If I understand correctly, each time new instance of Material is created.
– mloszek