Filip12345
Filip12345

Reputation: 53

How to make color of object in unity 100% opaque

I set color alpha to 1.0f, i set shader to transparent/diffuse

color = new Color(255/255f, 0/255f, 0/255f, 1f) //unity scales color to 1 AFAIK
go.GetComponent<Renderer>().material.color = color;
go.GetComponent<Renderer>().material.shader = Shader.Find("Legacy Shaders/Transparent/Diffuse");

But i can still see original texture behind the red color. How can i paint it red whole, so i won't see the original texture?

Thanks

Upvotes: 1

Views: 581

Answers (1)

Kevin V
Kevin V

Reputation: 159

Can you set the material texture to null? Like this ->

go.GetComponent().materials[1].mainTexture = null;

Upvotes: 4

Related Questions