Hi,
I’ve got an issue at changing the color of a material at runtime. I use the following code to set the color of the material using the HDRP Lit shader.
Renderer renderer = GetComponent<MeshRenderer>();
renderer.material.SetColor("_BaseColor", new Color(0f, 0f, 0f));
When I open the inspector during runtime, the value of the color had been changed on the material instance, but the object is not displayed accordingly (it is still displayed with the previous color). However, if I manually deactivate and reactivate the object, then the right color is displayed. Any idea on what I’m missing here ?