Changing materials properties during runtime

I am trying to alter my HDRP Lit material’s emissive color and emissive intensity but it does not get reflected on my gameObjects. I have even tried using “_EmissionColor” and still there was no change. However the material that is suppose to change, shows as (Instance). What am I doing wrong here?

public GameObject[] myGOs;

private void Start () {
        for(int i = 0; i<myGOs.Length; i++){
            myGOs[i].GetComponent<Renderer>().material.SetColor("_EmissiveColor", new Vector4(0.8196f,0.783f,0,1) * 3.0f);
        }
    }

Not entirely sure, but you wrote “_EmissiveColor” instead of “_EmissionColor”

Like I mentioned, I tried that as well and it did not change.

Make sure your original material has emission enabled and a color (non-black) set or it’ll get stripped out as a shader variant.

You should maybe enable the emission channel before applying the new emission

materials[i].EnableKeyword("_EMISSION");

edit : or in your case

myGOs[i].GetComponent<Renderer>().material.EnableKeyword("_EMISSION");