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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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.