How can i make some kinda Login System?

Hi peepz!

I'm wondering if you guys/girls could help me with my problem!

I need some kind of Login System thingy i know how to make the Password field and the Text field but this is my problem i dont know how to save the login details so you can exit the game without registering again and start all over!

If you can help me with this problem i would be so happy!

Thx in advance!

Typically, log-in systems are implemented using server-side scripting languages, such as PHP, Perl or ASP.

In this way, your unity player would act as a 'client', and would send the username & password which the user typed to the server. The server then looks this up in the users database, and gives the appropriate response.

If you are not using a server/client model however, you'll need to provide more information about how you are planning to have your registration system to work. Should it be that all user's information is stored on one machine? (this means if a user goes to play on another machine, their login & saved data will not be present).

See this answer:

How can I send a string or integer value to server side scripts or web services?

And google for login systems in your chosen server-side language:

Simple Log In System in PHP

Simple Log In System in ASP

Simple Log In System in Perl

These should get you on your way!

What Duck said. :) But to add some detail, you might want to read How Unity Communicates with the Browser. In particular, there are two functions:

SendMessage allows HTML Javascript to call a Unity object's function.

Application.ExternalCall lets Unity call HTML Javascript function.

By HTML Javascript, I mean the Javascript in the web-page's HTML - as opposed to Unity's own Javascript :)

So with these functions, you have two-way communication between your web-page HTML, and your Unity game. The HTML can handle any kind of authentication you need, and pass the results to the game.

As Duck says, you still have to implement the login checking somewhere, but at least these functions make it easier to pass the results to Unity.

Update: take a look at: Unity Browser Cookie Equivalent, it may be what you're looking for. It's a way of saving player preferences.

I'm surprised Duck hasn't already linked it. :)