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

2D

-

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)

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.