with this script the object material should slowly become transparent but after time spent disappeared suddenly and not gradually. How can I fix it?
#pragma strict
var materiale : Material;
var tempo : float = 5.0;
var minimo : float = 0.0;
function Start () {
materiale.color.a = 255;
}
function Update () {
if(tempo > minimo){
tempo -=Time.deltaTime;
materiale.color.a = tempo/(minimo*2);
}
}