TexField doesn't accept text

Having trouble with my GUI.TexField() I decided to just copy the code from the tutorial and only have the Hello World text field. That text field doesn’t let me enter any text.

The problem I have is with a text field that only lets me enter 1 character and that character can only a number, every alpha I try to enter gets the error:

FormatException: Input string was not in the correct format
at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0 

I have no idea why it is looking at NumberStyles. I do have a style used in another scene that is number style, but this one isn’t.

So clearly there is something I just don’t “get” about text field. I expect it to take input and redraw it in the text window, for that input to be any isalphanum, and since I didn’t put a limit on the width, to let my type as much as I want. (I also tried setting number of chars to 5 and still only can type in one number).

With it even failing to take text in the code directly out of the manual, something tells me there is some missing documentation. Given the durth of information in the GUI manual, that would not surprise me.

I’ll take links to solid tutorials that include the text area as well as a specific answer.

Oh the code for the one character box is in a loop and looks like this:

singleScore = eScore*.ToString();*

singleScore = GUI.TextArea(new Rect(10 + (60 * i) + (390 * column), 70 + 70 * eIdx - (column * (70 * numRows)), 60, 30), singleScore, 5);
Any help greatly appreciated.

You are resetting the text to the same one character every time OnGUI executes:

singleScore = eScore*.ToString(); // right here*
and if that i’th element doesn’t contain something good, it’s not going to work anyway.
See here: text field - inputting numbers only - Questions & Answers - Unity Discussions