- Home /
Question by
anonymous_16296 · Jul 13, 2019 at 04:17 PM ·
shaderscript.materials
Cannot change EmissionColor for HDRL/Lit shader from monoBehaviour
I am trying to change the emmisionColor for an object from the script but am unable to do so. The code I am using to change it is as follows
GetComponent<Renderer>().material.SetColor("_EmissionColor", color);
GetComponent<Renderer>().material.EnableKeyword("_EMISSION");
GetComponent<Renderer>().material.color = color;
I added the 2nd and 3rd lines trying to debug this issue. I am sure the color value is correct as I am successfully able to change the base color using it. Any help is appreciated
Comment
Tried that after reading your comment, didn't work