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 ![]()
// 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?
}
}
![]()