I have a Material which has an alpha texture and transparent shader. I want to controll its alpha value using script . How can I do that
Using
renderer.material.color.a = 0.5;
,where 0.5 is, obviously, an example value.
public float Tlevel = 2;
public Color color = Color.red;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// color.a = Tlevel/10;
color.a =Tlevel/10;
renderer.material.color= color;
renderer.material.color.a = Tlevel/10;
}
It works using
**public Color color = Color.red; **
** renderer.material.color.a **