- Home /
material.SetColor ("_EmissionColor", Color.white)
Have been trying for over and hour to fix this, I´ve been trying to use:
theGameObject.GetComponent().material.SetColor ("_EmissionColor", Color.white);
also tried:
theGameObject.GetComponent().material.EnableKeyword ("_EmissionColor"); theGameObject.GetComponent().material.SetColor ("_EmissionColor", Color.white);
also:
theGameObject.GetComponent().material.EnableKeyword ("_EMISSION"); theGameObject.GetComponent().material.SetColor ("_EmissionColor", Color.white);
and:
theGameObject.GetComponent().material.EnableKeyword ("_EMISSIONCOLOR"); theGameObject.GetComponent().material.SetColor ("_EmissionColor", Color.white);
But no matter what it doesn´t change the color. Altho when I open the inspector and click on my shader to open it´s properties, it activates (but the change in color is only visible in the Game and Scene windows, not in the inspector).
Answer by 1Elfo · Apr 16, 2015 at 12:46 PM
In the end I ended up adding a new material of the type "Sprite/Default" to the object and removing all the emission changes in the script since now they don´t do anything. Just posting this in case it´s of any use to anyone.