when button pressed, textfield appears

hey guys, i’m a newbie in Unity, and i’m working on an usability Platform.

I think i have an easy problem,… but not easy enough for me…

i just want when someone press my button, a textfield appears!

How can i solve this problem? :frowning:

Thanks a lot!! Tina :slight_smile:

Here is:

public class TestScript : MonoBehaviour {

    private bool showForm = false;
    private string myText = "";

    void OnGUI()
    {
        if (!showForm)
        {
            if (GUI.Button(new Rect(0, 0, 100, 20), "Show Form"))
                showForm = true;
        }
        else
        {
            myText = GUI.TextField(new Rect(0, 0, 100, 20), myText);
        }
    }
}
private bool textFieldActive = false;

void OnGUI()
{
    if (textFieldActive)
    {
        //place your textfield code here
    }

    if( GUI.Button(buttonRect, "Activate TextField") )
    {
        if (textFieldActive)
            textFieldActive = false;
        else
            textFieldActive = true;
    }

}

hello ZioRed!
What is monobehavior? and how can i use your script?
is it c#? and how do i have to bind it to my camera?

Tina :slight_smile: