So I’m using GUI.TextField to render text to the screen. What I’m looking for is an input field for the person playing the game to be able to input text for naming their character are any other wide range of things.
I can change the variable in the Unity Editor but not in the web player.
Remember to assign the return value back to the variable that stores the text…
strUsername = GUILayout.TextField(strUsername, 20, GUILayout.Width(100));
Notice that strUsername appears twice.
It is used both to set the text inside the text field when you start the application, and to return the new value after the user updated the field.
If you want to render text that will not be changed by the user, it’s usually better to use GUI.Label.
BTW- It will help if you post your code here if you still have problems.
I wasn’t resetting the variable when I was doing it and I don’t know why I didn’t think of it.
I was using: GUI.TextField(Rect(newNameLoc.x - 30, newNameLoc.y + 15, 450, nameBackPlate.height -2), newCharacterName, 25);
Thanks for the help.