GUI Textfield problem

Hi i have a GUI Textfield for my login system for people to log into and i want that GUI Textfield also to save the in game gamertag, i mean how can i add 2 things at a GUI Textfield this is my code:

userName = GUI.TextField (new Rect(25, 60, 375, 30), userName);

and i want to have:

userName = GUI.TextField(new Rect(25, 60, 375, 30), userName, MultiplayerScript.instance.PlayerName);

But if i then save and gonna login the Textfield disappear, its hard to explain and my english isnt so good, so hope somone will understand and help me :slight_smile:

Thanks.

If I understand correctly, both username entries are going to be the same. So, you can simply assign both at the same time and only use one in the GUI.TextField() function. Like this:

userName =
    MultiplayerScript.instance.PlayerName = 
    GUI.TextField(new Rect(25, 60, 375, 30), userName);

As far as I know there aren’t any rules against doing cascading assignments in this type of situtation.