Search Unity

Both Players Spawned have isServer = True

Discussion in 'Multiplayer' started by dalblas, May 22, 2017.

  1. dalblas

    dalblas

    Joined:
    Apr 9, 2014
    Posts:
    10
    Hi there!

    I have created a player prefab with a Network Identity set to Local Authority and have a Network Manager using the auto-create function on the prefab. I build the game to have a window for the client and use the Unity player for the server. When I have both players connected, one I choose as the Host and one I choose as the client, when I look at their Network Identity in the inspector they both show isServer = true.

    Why would this be happening?

    Thanks,
    Dan
     
  2. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    The isLocalPlayer, isserver etc is not a specific value for each object. It's per instance. So when you spawn a object it will run the code on the Server and all players. So when looking at the inspector you are probably running as "host". A host is server + client in one.
    Try to run dedicated server as standalone. Then join that server with a client in editor and isServer should be false
     
  3. dalblas

    dalblas

    Joined:
    Apr 9, 2014
    Posts:
    10
    I understand that it is per instance. I just ran the server only in the Unity player and had built and run a copy of the game to run as the client. When I look at the player(clone) in the inspector that was created when I joined as the client, it shows isServer to be true which it shouldn't when I read the documentation.

    isServer.jpg
     
    Baklusha and JFortunato like this.