Input string was not in the correcct format?

It says Input string was not in the correcct format whats wrong? Its string to integer correct?? Its problems is when it does int.Parse. da is assihned with an input box.

var da : String;
var daa  : int;

 Debug.Log("Pasing");
daa = int.Parse(da); 
 Debug.Log("Pased");
for (i = 0; i < daa; i++){
 Debug.Log("in");
bi = Random.Range(0, 6);
 Debug.Log("Randomixing");
networkView.RPC ("PrintTextb", RPCMode.All, bi);
}

What are you putting into the input box?

971023--36073--$Capture.PNGusualy 1 2 or 3 just one digit numbers

Note: The website link in your signature does not work.

Bump?:slight_smile:

?

int.Parse will throw an Exception if you pass it a string that cannot be converted to an integer. You need to either catch the Exception and handle it appropriately or you need to use int.TryParse which will return true or false depending on whether or not the conversion succeeded.

Given the overhead of catching Exceptions I tend to prefer the TryParse method - but the choice is your’s.