Metallic texture issue

Hi

I get 2 issue for assign a texture from disk to Metallic by script

1:

Material.SetTexture("_MetallicGlossMap", Texture);
Material.EnableKeyword("_MetallicGlossMap");

It’s not working until expand material Inspector

2:
Then I set smoothness:

Material.SetFloat("_Glossiness", value);

The smoothness value can’t be changed by script if metallic texture assigned

What’s wrong?

Can anyone help me, thank you

The keyword is _METALLICGLOSSMAP, the capitalization matters.

Because the _Glossiness property isn’t used when the metallic keyword is set. Instead it uses the _GlossMapScale property multiplied by the metallic or albedo texture’s alpha.

1 Like

Thank you bgolus

It’s working!~