I am making a multiplayer game using Unity3D, similar to SecondLife (but focusing on a particular gameplay task). Users will be able to register/login directly in the game and their character will be spawned. So far, I have made the back-end Rest-ful API to manage users. I am able to use login and register from the unity itself ( Using REST Calls e.g. www.myDomain.com/api/login ) but how do I spawn the characters accordingly?

Also, currently I am making a token based authentication system for the API ( much like Facebook, Twitter) as the API itself is state-less. Should I be storing the tokens in playerprefs?

I have gone through this tutorial but it doesn't seem to solve my problem. Any kind of direction will help. Thank you.

  • \$\begingroup\$ Suggestion: When implementing Auth, don't reinvent your own and just go with some library implementing OAuth2. \$\endgroup\$ – user42555 Mar 24 '14 at 8:43
  • \$\begingroup\$ Thanks. I am going to try out HybridAuth as suggested by others. Still, I am looking for spawning mechanism. \$\endgroup\$ – Abhishek Deb Mar 24 '14 at 9:30

Ill just point you in the right direction.

Probably should use photon networking and if you want to know the basics of that this is the video series for you.


Spawning players is pretty straightforward in unity.

  • \$\begingroup\$ Yes, I have heard about it. I'll check out the video and reply. Bdw, I should be using Photon PUN right? \$\endgroup\$ – Abhishek Deb Mar 24 '14 at 10:36
  • \$\begingroup\$ Yes you can use Photon or try to roll your own server. Unity has an example server you can use and modify to your needs if you want..... buuuuuut probably in most cases just go with Photon unless you really need some custom logic. Yes PUN photon Unity Networking. It will simplify your life for sure. \$\endgroup\$ – Ray_Garner Mar 24 '14 at 14:37
  • \$\begingroup\$ Thankz.. Definitely going with this. The Video is very much helpful. I am downloading all the videos now. Bdw, After authentication from Photon, do I need to store the authentication in PlayerPrefs? I haven't watched all the videos yet and haven't touch the API DOCs.. \$\endgroup\$ – Abhishek Deb Mar 24 '14 at 18:29
  • \$\begingroup\$ I do not know if you have to but probably should just in case. \$\endgroup\$ – Ray_Garner Mar 24 '14 at 20:36
  • \$\begingroup\$ Glad this helped you good luck! \$\endgroup\$ – Ray_Garner Mar 24 '14 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.