How do I make a grey cube transparent?

var colorStart : Color = Color.red;//Changed to grey
var colorEnd : Color = Color.green;//Changed to transparent grey
var duration : float = 1.0;
var lerp : float = 0.5;

function Update () {
    var lerp : float = Mathf.PingPong (Time.time, duration) / duration;
    renderer.material.color = Color.Lerp (colorStart, colorEnd, lerp);

    renderer.material.color = new Color(0, 0, 0, 50);

    renderer.material.color.a = 0.5;

    var c : Color = renderer.material.color;
    c.a = 0.5f;
    renderer.material.color = c;
}

How do I make an object transparent? It currently is not equipped with any textures at all, and I'm just trying to make the thing transparent to mark for the players that "Hoy! There is something in this zone, so get over here!" A grey transparent cube marking a zone. How would I do this?

BTW, none of the things written above work. Either because I have no idea why, or some other reason. Care to point me out why?

Hi,

If your shader doesn't support transparency, you won't have any. So on that material applied to your gameObject you want to change transparency, make sure you select a shader that deals with alpha channel.

When you select a material, there is a "shader" property. It will let you select amongst a wide varieties, and pick one from the transparent category like "Transparent/Diffuse". Then depending on your need/performances, you'll need to pick a more appropriate one.

You'll find all built in shaders described here

Bye,

Jean