GUI TextField Not Editable

Hello, I am having this issue where my text field appears on the screen, but i can not enter text into it. I have been looking for the problem for hours but have had no luck! I think one of you smarties out there would be able to help :slight_smile:

Here’s my script (It’s in C#):

public class Database : MonoBehaviour {

public static string user = "";
private string password = "", rePass = "", message = "";

 private void OnGUI(){
	
	if(message != ""){
		GUILayout.Box (message);
	}
	
	GUILayout.Label ("Username");
	user = GUILayout.TextField(user);		
	GUILayout.Label ("Password");
	user = GUILayout.PasswordField(password, "*"[0]);	
	GUILayout.Label ("Re-Enter Password");
	user = GUILayout.PasswordField(rePass, "*"[0]);

If anyone could tell me why this isn’t working then i will be extremely grateful!

Change the last two to be password=...password and rePass=...rePass. In general, that’s the format – same variable insdide parens (which says to display it) as in front of the equals (which says to change it when user types more.)

The first TextField is working perfectly, but then the next two reset user back to “” (enter some in the other fields to see.)