So what i want to do is be able to press a gui button on my screen ( which will say ACOG ) , and when i click it the acog renderer will be enabled , and the iron sights will be turned off , but when i click the acog button instead of 2 buttons it will say iron sights where the button acog was. heres the code :
var attachmentOne : GameObject;
var attachmentTwo : GameObject;
function Update ()
{
if ( Input.GetButton("Disable1"))
{
attachmentOne.renderer.enabled = false;
}
if ( Input.GetButton("Disable2"))
{
attachmentTwo.renderer.enabled = false;
}
}