Hello
I’m trying to acces to my material with a script
It can seem simple but I cant set the emission color with the code below, it just doesn’t works
( I have an instance which have the material on the scene before the playmode starts )
private Material matBane;
private Color colort1 = new Color(.2f, .1f, 0, 1);
void Start()
{
matBane = GetComponentInChildren<SkinnedMeshRenderer>().material;
}
public void SetColor()
{
matBane.EnableKeyword("_EMISSION");
matBane.SetColor("_EmissionColor", colort1);
}