Idk whats going on but it doesn’t seem I can’t set the emission color.
Color DefaultColor = Color.red;
EyesMat.SetColor("_EmissionColor",DefaultColor);
Idk whats going on but it doesn’t seem I can’t set the emission color.
Color DefaultColor = Color.red;
EyesMat.SetColor("_EmissionColor",DefaultColor);
You also need to also enabled the _Emission
keyword, and potentially also the GlobalIlluminationFlags
. Or, just enable emission on the material by default with a very dim color value, or set it to black in script at runtime, rather than trying to enable it later. That also avoids issues of shader variants where the version of the shader with emission enabled may not be built and included with the game since the assets themselves don’t use it at build time.
Thanks for the reply @bgolus
Ya I have emissions enabled.
I have it set to white right now.
Then trying to change it to red in script.
Never had any issues with this before. Idk what the heck.
Unity standard shader too.
Alright scratch all that. I guess it does work.
Apparently Color can’t be null. This was turning false.
Color DefaultColor;
if(DefaultColor == null){
//change emission color
}