0
\$\begingroup\$

I hope this is the right place to ask my question... I have been working on a game (all 2D) and I'm facing some problem with the networking part (pretty much a beginner).

My game idea is a shared screen (the server) and multiple devices (clients) where every player will get different tasks/objectives. So after I spawn the players initially I just set them to not active on the server. That way the players can share the screen. After spawning the player on the client side, the player will have a screen to select an avatar and enter their name. On the server side, I would like to have the player selected avatar and name show up by spawning another object. The problem is that once the object is spawned it's not being updated on the server with the information from the client, even when using [Command].

Images to help understand the problem: http://imgur.com/a/8pJu5

Any help is appreciated it :)

\$\endgroup\$
  • \$\begingroup\$ Could you add the script to the question? The link is dead now. \$\endgroup\$ – Alexandre Vaillancourt Feb 20 '17 at 11:50
0
\$\begingroup\$

Consider tagging player related variables with the syncvar attribute. See unity docs https://docs.unity3d.com/560/Documentation/Manual/UNetStateSync.html

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks! The problem I had was that the values on the server were not synced with the client. \$\endgroup\$ – A. Yassin Feb 3 '17 at 12:19

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.