Making an object transparent by pushing a GUIBotton

Hey,
Does anyone knows how to make an object transparent with a GUIBotton?

Just attach the gameobject to the script and when the button is pressed change the alpha value (and make sure you have a shader which supports it on the material.

The thing is I dont have the script :stuck_out_tongue:

// C#:
...
public GameObject Obj;
public Material Mat;
void OnGUI()
{
    if(GUI.Button(new Rect(0,0,64,64), "Click me!"))
    {
        Obj.gameObject.renderer.material = Mat; // Material with Transparent Shader?
    }
}

:smile: