How do I fade just the alpha level of a material? (Java)

Edit: I ended up just rewriting the Alpha Blend shader which aloud it to be called using color.a so this approach was much easier. As for the shader I have clipping problems with billboarded trees, does anyone know how to fix this?

I’ve seen some other examples fading the alpha of a material, but they’re all in C# and I can’t seem to get them converted properly.

Does anyone know how I can fade just the alpha level of a material? I don’t like the other method of using “_TintColor” as it turns everything black before it fades. (I’m using aloha blended)

I know that I have to use color.a, but it doesn’t seem to work because the material is being called from a game object heavyClouds.

Here’s what I have:

cloudsStormy = cloudsStormy.a;

	      heavyClouds.renderer.material.color = Color.Lerp (cloudsStormy, 
                  cloudsStormy, fade);

If anyone can help me out that’d be great and I’m sure it’ll help others who have a similar question out too.

Do you mean something like this?

private var myRenderer : Renderer;

function Start () {
    myRenderer = renderer;
}

function Update () {
    if (myRenderer.material.color.a>0) 
        myRenderer.material.color.a -=1.0*Time.deltaTime; //Fade out over 1 second
}