1
\$\begingroup\$

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.

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

1 Answer 1

1
\$\begingroup\$

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.

https://www.youtube.com/watch?v=AIgwZK151-A

Spawning players is pretty straightforward in unity.

\$\endgroup\$
5
  • \$\begingroup\$ Yes, I have heard about it. I'll check out the video and reply. Bdw, I should be using Photon PUN right? \$\endgroup\$ Mar 24, 2014 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, 2014 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\$ Mar 24, 2014 at 18:29
  • \$\begingroup\$ I do not know if you have to but probably should just in case. \$\endgroup\$
    – Ray_Garner
    Mar 24, 2014 at 20:36
  • \$\begingroup\$ Glad this helped you good luck! \$\endgroup\$
    – Ray_Garner
    Mar 24, 2014 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .