I'm trying to convert a string, entered by the player into a Gui.textfield, into a float. However, Im constantly getting this error: "FormatException: Invalid format. System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) System.Single.Parse (System.String s)"
My code is as follows:
string str_inputAmount = "";
str_inputAmount = GUI.TextField(new Rect(v3_screenPos.x + 55f, v3_screenPos.y - (i * 55f), 50f, 50f), str_inputAmount, 4);
float inputAmount = 0f;
inputAmount = float.Parse(str_inputAmount);
What could my solution be?