Search Unity

All players except host can control all players that log in after them? [SOLVED]

Discussion in 'Multiplayer' started by QuinnWinters, Aug 15, 2017.

  1. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    494
    I'm having a unet issue I can't pin down. I'll launch a host and have a controllable player in it (player 1). Then I launch a client and it too has a controllable player in it (player 2). Both players see each others movement and everything works as it should. Then when I launch another client and log a third player in (player 3) the third player is controllable and the other two players see it and everything appears to be fine, but if I then go back to the second window and try to control player 2 it controls itself plus it also controls player 3. Any further players I log in can all be controlled by any player that was logged in before them except for by the host.

    As there is really not any code to speak of my best guess is I have a setting wrong somewhere in the network manager or perhaps it's because I'm logging in from localhost on each of the clients.

    Does anybody have any idea what might be causing this? Currently using unity v5.4.0.
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Make sure you're using isLocalPlayer in your control code. Otherwise you'll be controlling everybody.

    Also, you should upgrade. It's rather old version of Unity.
     
  3. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    494
    It turned out the problem I was having was due to a flaw in the tutorial I had originally followed last year. Following the Christian Arellano tutorial I was able to get it to work as expected.

    Your right I should upgrade. I'm bad about getting involved in projects to the exclusion of all else and multiple updates come out before I even notice.