I’m trying to hide an object when I press a button on the screen. The object I’m trying to hide is called CubeInterface, and is also tagged as CubeInterface. The script is attached to CubeInterface. However, I’m getting an error with the code.
var customButton : GUIStyle;
function OnGUI () {
if( GUI.Button( Rect( 550, 220, 100, 30 ), "here", customButton ) ){
CubeInterface.gameObject.active = false;
}
}