Question about materials

Hello
I’m currently using this methos to change an object’s color:
renderer.sharedMaterial.color = Color.red;

and I can see in the profiler that every time I do this, then the CPU get’s used and I wonder if it’s better to assign the object a new material rather than changing the materials color.

Thanks for reading
-Frank

Without testing anything, I would say the way you are doing it is better. Suppose you have a material with a big number of properties - changing one property should be faster and use less memory than changing the whole material.

However, since you can use the profiler you can test both approaches and decide which one is better.