Manipulate Alpha in Script

This isn’t working for me. If I manipulate the _Shininess propery, it works, but this does not.

        float alpha = 0.0f;
        renderer.material.SetFloat("_Cutoff", alpha);

edit

this works as an alternative

renderer.material.SetColor("_Color", new Color(1, 1, 1, val));

renderer.material.color.a = 0.0f; should work…

Is that a JavaScript thing?

I get the following when I try that in C#.

error CS1612: Cannot modify the return value of `UnityEngine.Material.color’ because it is not a variable

My mistake! Forgot you had to pick it up all in one piece.

var holder : Color = renderer.material.color;
holder.a = 0.0f;
renderer.material.color = holder;