Get account user name

How would I be able to access an account user name from a site when I log in to the site and launch my game?

For example, I make an account on a site with the user name “guy”. I log into that account, Play a unity game on that site, and it displays “guy” as my name in the game. How would I do this?

Most of that will probably happen from outside the Unity engine. You will need a database of all your users. From there, you could do a number of things based on what you think is the best for your individual situation.

You can have the user log into your website (not the game at first). Then pass that information to the web player when the time is right. Something like this page.

You could also have your user log directly into your web player. For this, you would probably want to upload the database (or parts of it) using WWW then do log ins fro that.

Sounds like you need to use MySQL/php to create the site where the accounts are created and stored, and you’d query a php page connected to that database from Unity to have users log in while playing.

This is not a trivial thing to set up, and you won’t get a copy/paste answer to that question here at Unity Answers.