Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.1
2020.1.4f1
2020.2
Issue ID
1276688
Regression
No
'MainTex' property of a custom material is not updated when selecting a different texture in the Inspector window
How to reproduce:
1. Open the user's attached project
2. Open the 'Maze' Scene
3. In the Hierarchy window select the 'Wrong' object
4. In the Inspector window expand the 'Wall (Material)' component
5. Press 'Select' on the right of the 'MainTex' property
6. In the 'Select texture' window double-click on 'None'
7. Open the 'Select texture' window again
Expected result: The 'MainTex' property gets updated to 'None'
Actual result: The 'MainTex' property doesn't get updated and remains set to 'All'
Reproducible with: 2020.1.6f1, 2020.2.0b2
Cannot test with: 2018.4.27f1, 2019.4.11f1 (due to errors)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Scene View becomes gray and "NullReferenceException" errors are thrown when attaching the Unity Editor process to RenderDoc
- Memory usage rapidly rises when changing colors in the color wheel
- Physically Based Sky's Horizon and Zenith Tint Color Selection Bars don't have immediate access to color pickers
- EmptyAdditionalLightShadowmapTexture leaks from memory when URP quality level is changed using QualitySettings.SetQualityLevel
- Referenced ScriptableObject field does not get updated and cannot be set to "None" when there are no Objects of that type
Resolution Note:
The _MainTex property of a material used by a SpriteRenderer is overridden by the renderer and will always point to the Sprite texture, regardless of what texture you assign to the material asset. In fact, it you create a material from the default sprite shader, you will find that the _MainTex field is disabled in the Inspector. However, shaders created using Shader Graph don't support this behavior, so you are still able to freely assign any texture. However, for the reason mentioned above, you should not do that.