Many of the materials in a game may be variations on a source—outfits with a variety of color schemes, damaged and undamaged versions of scenery, shiny and weathered instances of props. To help you manage and maintain these materials, Material Variants address specific shortcomings of copied materials, as illustrated in this table.
Copied material | Material Variant |
---|---|
Does not automatically change if its source material changes. | Automatically changes if its parent changes. |
To replicate a change to a copy in its source material, you must manually adjust the source material. | You can copy changes from a child material to its parent with two mouse clicks. |
You can’t limit changes to the Properties of copies. | You can lock one or more Properties on a Material or Material Variant to prevent modifications to those Properties in its children. |
You can’t associate a copy with a different source. | You can reparent Material Variants. |
You can create Material Variants from both Materials and other Material Variants. It is also possible to convert Material Variants into Materials. To use the Override(s) in a variant with a variety of different Materials, you can change the parent of that variant.
See Create, modify, and apply Material Variants for information about how to create and convert Material Variants.
See Material Variant inheritance for an explanation of the Material Variant hierarchy.
It is possible to create a Material Variant from any Material, including one you make with Shader Graph or download from the Asset StoreA growing library of free and commercial assets created by Unity and members of the community. Offers a wide variety of assets, from textures, models and animations to whole project examples, tutorials and Editor extensions. More info
See in Glossary. See Create, modify, and apply Material Variants for detailed information about how to create Material Variants from shadersA program that runs on the GPU. More info
See in Glossary.
An Override is a change you make to a Material Variant’s Properties. You can revert one Override at a time or all Overrides at once. Unity does not handle reverts through the Undo stack, which means that you can revert an Override without undoing any other changes.
See Create, modify, and apply Material Variants for detailed information about how to identify and revert Overrides.
Unity protects against ancestor deletion and circular dependencies. If you attempt to delete the parent of a Material Variant, Unity warns you to select a new parent for the child or reparent it.
See Material Variant inheritance for detailed information about Material Variant hierarchies and inheritance error messages.
You can use the Material Variant API to access Material Variant functionality for complex or large operations.
See the MaterialAn asset that defines how a surface should be rendered. More info
See in Glossary and MaterialEditor API documentation for information about how to work with Material Variants in scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary.
Prefab Variants and Material Variants have much the same functionality, foundational concepts, and workflow. There are two key differences between them:
Material Variants are not designed to address optimization and scalability concerns. In addition, it is not possible to use Material Variants to alter Materials at runtime in the Player.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.