I have twoo objects. A sphere and a cube. I want to change the sphere’s color (with OnMouseDown) if the cube’s color is red.
Try this
if( cube.renderer.material.color == Color.red )
{
cube.renderer.material.color = sphere.renderer.material.color;
}