Search Unity

Multiple players on one client and isLocalPlayer

Discussion in 'Multiplayer' started by scott-arms, Jan 28, 2019.

  1. scott-arms

    scott-arms

    Joined:
    Jul 18, 2013
    Posts:
    1
    Hi,

    I am writing a multiplayer game where there needs to be two distinct players on each client. We have managed to spawn the players by writing a modified network manager, but now it seems that using isLocalPlayer does not work as we would wish.

    When we only have one player on each client we can use isLocalPlayer to filter out input so that each client will only control one player. But now, when we have two players on each client, isLocalPlayer always returns false for the second player, so they cannot move. We have seperate controls set up for each player on each client.

    Any ideas?

    Thanks in advance.
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,068
    You could treat the separate players both as belonging (locally) to one client or it might make sense to separate the input handling from the spawned characters. With multiple players per device, you need to figure out which input affected which character, anyways.

    Did you make any progress?