make an object slowly appear

Hello! i would like to make an object slowly appear at a certain time. I tried to animate its alpha value but it doesn’t work. There aren’t any errors but in the game the object is always visible, from the starting (i’ve set the starting opacity value at 0). My code is something like this:

var opacity float;

function Start () {
    opacity = 0;
}

function Update () {
    if (Time.time > 3) {
        renderer.material.color.a = opacity;
        opacity += 0.2*Time.deltaTime;
    }
}

Where am i wrong?

float appearing_speed = 2f;

void Start()
    {
        transform.localScale = new Vector3(0,0,0);
    }

	void Update () {
        if(Time.time > 3){
       transform.localScale =  Vector3.Lerp(transform.localScale, new Vector3(1f, 1f, 1f), 
       appearing_speed  * Time.deltaTime);
        }
	}

I don’t think you can edit the alpha component directly. Perhaps try something like this:

var opacity float;
var c Color;

function Start () {
    opacity = 0;
    c = renderer.material.color;
}

function Update () {
    if (Time.time > 3) {
        c = new Color(c.r, c.g, r.b, opacity);
        opacity += 0.2*Time.deltaTime;
    }
}