So currently I have a game object that is making use of a material with a “Legacy Shaders/Diffuse” shader and the main color is (255, 0, 0, 255) which is perfect and looks like this:
![]()
but I would like to change the color as the player progresses to the next level which I have done, the problem is when I apply the new material the game object looks completely different, it looks like this:

All my lights’ Baking attribute are set to Realtime.
This is how I change the color:
Material material = new Material(Shader.Find("Legacy Shaders/Diffuse"));
material.color = new Color(255, 0, 0, 255);
Renderer rend = GetComponent<Renderer>();
rend.material = material;
Any help would be greatly appreciated.
Ok I replaced all my lines with yours and it still does the exact same thing. I started playing around with different shaders and I found that the "Unlit/Color" shader is basically what I am ending up with when I change the color with either my or your code. It kind of looks like the material is losing some attributes when changing the color, well that is all I can think of at the moment.
– CBRZYI was having the same error and fix it by calling the Coroutines OUTSIDE the Update function, as stated here: // fix the warning IEnumerator LoadNextAsyncScene() One should also read this: [https://docs.unity3d.com/ScriptReference/AsyncOperation.html][1] [1]: https://docs.unity3d.com/ScriptReference/AsyncOperation.html
– musicartslao