I am trying to set the emission color of raycasted material to “select” an object. Raycasting works and hitMaterial.GetColor(“_Emission”) returns the right color but still the object doesn’t change color.
Material hitMaterial = hit.transform.gameObject.GetComponent<Renderer>().material;
Color selectionColor = new Vector4(0, 80, 0, 225);
hitMaterial.SetColor("_EmissionColor", selectionColor);
Debug.Log (hitMaterial.GetColor("_EmissionColor"));
Material shader: Standard (Specular setup)