Not signed in
Copyright © 2026 Unity Technologies
Thank you for the report and the repro project. After investigating, this works as intended, so we are closing the case. Some shader keywords and the material's render queue come from material properties. For example, the URP Lit shader sets the _ALPHATEST_ON keyword and the render queue from the _AlphaClip property. Unity sets these values again whenever a material is created, imported, or edited. In your example, the script enables _ALPHATEST_ON and sets renderQueue directly, but leaves _AlphaClip at 0. When the material is reimported, Unity sets the keyword and render queue from _AlphaClip again, which resets your changes. To get the result you expect, set the property that controls these values instead. For alpha clipping on the URP Lit shader, set _AlphaClip to 1, for example material.SetFloat("_AlphaClip", 1). Unity then enables _ALPHATEST_ON and sets the render queue for you. This also explains what you saw with EditorJsonUtility: the data is written to JSON and read back correctly. The keyword and render queue are reset afterwards from the material properties, so they are not lost during serialization. We'll consider updating the documentation to make this clearer. Thanks again for helping us improve Unity.
Unity 6000.2 has reached its end of life and will not receive further updates. If you need additional fixes, please upgrade to a newer Unity version.
Cancelling: the 6000.1 version has reached its end of life. If you need additional fixes, please upgrade to a newer Unity version.
Unity 2021.3 has reached its end of life and will not receive further updates. If you need additional fixes, please upgrade to a newer Unity version.
How to reproduce:
1. Open the “IN-94661_repro“ project
2. Open the “SampleScene“
3. Enter Play Mode
4. Observe the Console
Expected result: Imported Material and Modified Material properties are the same
Actual result: Imported Material and Modified Material properties are not the same
Reproducible with: 2021.3.49f1, 2022.3.59f1, 6000.0.41f1, 6000.1.0b9, 6000.2.0a6
Reproducible on: Windows 10, Windows 11
Not reproducible on: No other environment tested
Sign in to see your voted issues