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: https://i.sstatic.net/00M0K.jpg

Any help is appreciated it :)

\$\endgroup\$
1
  • \$\begingroup\$ Could you add the script to the question? The link is dead now. \$\endgroup\$
    – Vaillancourt
    Commented Feb 20, 2017 at 11:50

1 Answer 1

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
  • 1
    \$\begingroup\$ Thanks! The problem I had was that the values on the server were not synced with the client. \$\endgroup\$
    – A. Yassin
    Commented Feb 3, 2017 at 12:19

You must log in to answer this question.

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