To Stop the leaking materials into the scene red error

Coloring the tops in the scene is perfectly acceptable, but you have to create a copy of the shared material first, alter that and then assign the copy back to the shared material.
As follows;
Material tempMaterial = new Material(transform.Find(“Top”).GetComponent().sharedMaterial);
tempMaterial.color = color;
transform.Find(“Top”).GetComponent().sharedMaterial = tempMaterial;
this allows you to change each color of the top quad, and prevents the red error in the editor

Privacy & Terms