hello, sorry, i’m still new to unity and this is my first time i’m joining this forum. ![]()
i make an application using unity, i have some problem to hide button after several seconds. if some one of you knows how to do this, please help me. thanks. ![]()
this is my script:
var Delete : Texture;
var Duplicate : Texture;
var deleteObject : boolean = false;
var duplicate : boolean = false;
function OnMouseUp ()
{
deleteObject = true;
duplicate = true;
}
function OnGUI()
{
if (deleteObject)
{
GUI.backgroundColor = Color.white;
if(GUI.Button(Rect(465,50,40,40), GUIContent(Delete)))
{
Destroy(gameObject);
}
}
if (duplicate)
{
GUI.backgroundColor = Color.white;
if(GUI.Button(Rect(510,50,40,40), GUIContent(Duplicate)))
{
Instantiate (gameObject);
}
}
}