Unity Issue Tracker - Material.HasTexture/HasProperty returns true for non-existent property after calling setTexture
Closed
UUM-20075
Material.HasTexture/HasProperty returns true for non-existent property after calling setTexture
Unity: Shader System
Won't Fix
2023.2.X
2023.1.X
2022.2.X
2022.1.X
2021.3.X
2022.1 has reached end of life so the issue will be fixed in a newer version.
How to reproduce:
1. Open the user-attached project “ShaderPropertyBug”
2. Enter the Play Mode
3. Observe the Console
Expected result: There is no error message because Material.GetTexture shouldn’t be called since Material.HasTexture is false
Actual result: There is an error message because Material.GetTexture is called
Reproduced with: 2021.3.12f1, 2022.1.23f1, 2022.2.0b15, 2023.1.0a19
Couldn’t test with: 2020.3.41f1 (Material.HasTexture can’t be called)
Reproduced on: Windows 11 Pro
Note: Also reproduced in Player
Prioritise and Follow this issue
Have a workaround or additional info about this issue?