Fade out a material that has a texture

Ok what I am asking for is fairly simple however it is giving me problems. I have also seen similar questions asked but none of the suggestions have worked for me. I am trying to create a shock wave that expands outwards then fades away programaticaly. I am using this code:

var Dammage : float = 1;		//How much dammage the projectile does on impact;
var Speed : float = 1;			//How fast does the projectile move
var Lifetime : float = 10;		//How long does the projectile last

private var TimePassed : float = 0;

function Update () 
	transform.localScale += Vector3(Speed,Speed,Speed);
	TimePassed += Time.deltaTime;
	if(TimePassed >= Lifetime / 2)
		//Fade Material
		renderer.material.color.a = 1 - 1 * TimePassed / Lifetime;
		Debug.Log("Should fade");
	if(TimePassed >= Lifetime)

This does not throw up any errors in the compiler nor at run-time, however it also has no effect. The material I am using is a “Unlit/Transparent” so it does have an alpha channel. However, it does also have a texture assigned to it that has its own alpha settings. Is there something special I need to do to get a material to fade out when it has a texture, or am I just doing something wrong?

Thanks in advance for the help : )

You need a shader that 1) supports transparency and 2) has an Color property. Unlit/Transparent does not have an Color property, so setting the alpha value in the color does nothing. I use a shader that came with another package for what you are doing here, but I believe this shader from the Wiki should do the job:


Also Unity’s Diffuse shader has a Color property, so you can start by using that and put a directional light in the scene just to get your code working.