0

Hi, I have a problem with simple login (from here https://github.com/bdodroid/SimpleScripts-LoginSystem) Everything works fine but when i want to log in it says:

ArgumentNullException: Argument cannot be null. Parameter name: s System.Int32.Parse (System.String s) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629) Login+c__Iterator13.MoveNext () (at Assets/xxx/Demo/Login.cs:118)

Row 118 in my Login.cs is:

    userID = int.Parse(parsedData[1]["ID"]);

Please help me, i have the same code as here so you can check https://github.com/bdodroid/SimpleScripts-LoginSystem

Thank You!

1 Answers1

2

Row 119 in Login.cs says:

responseText.GetComponent().text = "CONNECTED";

and the error you got said null exception. This means that the responseText didn't have a Text Component or the responseText is never assigned a GameObject in the editor. responseText is declared as such:

public GameObject responseText;

which means it will be serialized in the Unity editor and you have to assign it yourself. Simply drag your ResponseText Object to the field in the editor.

Fredrik Schön
  • 4,888
  • 1
  • 21
  • 32