Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Server Storing Variables For Each Client

Discussion in 'Multiplayer' started by joshf26, Aug 17, 2014.

  1. joshf26

    joshf26

    Joined:
    Oct 7, 2013
    Posts:
    3
    Hello!

    I have recently began working with multiplayer games in Unity. I am not using Photon Unity Networking but rather the built in networking inside Unity.

    In the game I am trying to create, each player has their own money, and inventory variables. My original plan was to store these variable client-side, but I realized this was a bad idea.

    What would be the best way to store these variable like money and inventory on the server? I tried making a "Player" class on the server, and created an instance of the class for every player that connected. However, after days of research and experiments, I was unable to find a way to do so successfully.

    I'm sure this is a common concept for multiplayer games. So I was wondering if someone could point me in the right direction on how to do so.

    Thanks in advance!
    - Josh