- Home /
Color change if object has a specific color.
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.
Comment
Answer by Sundar · Dec 17, 2013 at 12:16 AM
Try this
if( cube.renderer.material.color == Color.red )
{
cube.renderer.material.color = sphere.renderer.material.color;
}