Right now I have it to where a player enters a string for their name, and then pushes the submit button. But the submit button and and textField aren't going away after that. I tried doing GUI.enabled = false and a few other things. I don't want to turn off the GUI completely, just that textfield and button. Can someone point me in the right direction?
What Jessy said.
Create a private boolean var called something like "isLoggedIn", and set it to false upon declaration (if you don't set a value explicitly it should default to false anyway).
Then put all the GUI code for your login form in OnGUI() inside:
if(isLoggedIn == false){
//login form code here
}
And upon successful login (I assume a GUI.button called "submit" or something that checks if the credentials are legit), set isLoggedIn to true.
The built-in GUI system is immediate-mode. This means that controls only exist for the update cycle in which you explicitly create them. It also means that the way to remove them is to stop creating them.
In practical terms, this probably means having some sort of variable that indicates whether those particular controls should be displayed, and only displaying them when the variable indicates that they should be displayed. (Or using a separate component as Justin Warner suggested, although there might be some disadvantages with that method in terms of performance and code organization.)