- Home /
Remove color of an object
Hi somebody please help me.
I just want to remove the color I have set to an object through the code "cornea.renderer.material.color=Color.blue;"
How is it possible to remove the blue color without affecting the texture of object.
Thank you.
Answer by tanoshimi · Jan 07, 2015 at 08:33 AM
Set it back to whatever it was before you changed it to blue... at a guess:
cornea.renderer.material.color = Color.white;
Answer by Juice-Tin · Jan 07, 2015 at 08:38 AM
What tanoshimi said.
Colors in unity are multiplied, and so white is actually default colours, and not pure white like this webpage.
The way in which colours/textures are combined in a material depends on the shader - they can be added, multiplied, subtracted, inverted, replaced... that's why I was guessing :)
$$anonymous$$y object cornea has a custom texture and I have set it to blue when a collision occurs. I want to remove the blue color on another collision.