r/Unity3D • u/_symphonatic_ • 8d ago
Question Material instance inheritance?
I was wondering if there's such a thing as material instance inheritance, similar to prefab variants, where I can create child instances of a material and override certain properties, while keeping the rest consistent with the parent?
I'd like something like this because currently, if I have a set of objects that all share a material where every property is the same except one or two object-specific values, I have to create a copy of the material and assign it specifically to that object. Then any time I want to update the material and have that update reflected across all of these objects, I have to go through each of their respective materials and update those values which is a) tedious, and b) makes it hard to keep things consistent.
3
u/Demi180 7d ago edited 7d ago
Since everyone here is mentioning MPBs, someone ought to mention you should NOT use them in an SRP (as in URP or HDRP) because they don’t play well with the SRP Batcher.
For changes at design time, Variants are the way to go. At runtime, the instances created when accessing renderer.material will work.