I’m am going through all my object and setting their SpecColor to black during gameplay but some of my objects don’t have the SpecColor property. Although this doesn’t seem to cause a problem in game I still get a console error for each object that doesn’t have this type of material.
Material doesn’t have a color property ‘_SpecColor’
I have tried:
oldSpecularColor=this.gameObject.renderer.material.GetColor("_SpecColor");
if(oldSpecularColor!=null)
{
this.gameObject.renderer.material.SetColor ("_SpecColor", Color.black);
}
But the error seems to occur when I try to get the color.
Cheers