Answers for "unity set transparency of whole object"

C#
2

unity change transparency script

public GameObject gameObject;

//gameObject.GetComponent<Renderer>().material.color = new Color(r, g, b, a);
//gameObject.GetComponent<Renderer>().material.color = new Color(255.0f, 255.0f, 255.0f, 0.0f);
gameObject.GetComponent<Renderer>().material.color = new Color(255.0f, 255.0f, 255.0f, 100.0f);
Posted by: Guest on August-27-2021
0

How to make game object transparent in unity

GameObject g;

// 50% Transparency.
g.renderer.material.color.a = 0.5f; // a is the alpha value.

 // 100% Transparency.
g.renderer.material.color.a = 1.0f;
Posted by: Guest on July-01-2021

Code answers related to "unity set transparency of whole object"

C# Answers by Framework

Browse Popular Code Answers by Language