I have an empty game object called GameController, with a script attached by the same name. Here is an exerpt from that script that applies to this question
void Update ()
{
if (restart)
{
if (Input.GetKeyDown (KeyCode.R))
{
Application.LoadLevel (Application.loadedLevel);
}
}
}
I want this script to destroy a GUIText tagged “IText” when R is pressed. This would go under the input.getkeydown If statement, but when I add
Destroy(gameObject.tag = "IText");
below the application.loadlevel, I get a bunch of errors. How should I be wording this