Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Many players per client

Discussion in 'Multiplayer' started by clerg0, Jun 16, 2015.

  1. clerg0

    clerg0

    Joined:
    Jun 16, 2015
    Posts:
    4
    Hi,

    As it's written here http://docs.unity3d.com/Manual/UNetPlayers.html, you could have many players per client because you can register different playerControllerId per Connection on the Server.

    I tried to override OnServerAddPlayer on the NetworkManager to Instantiate and Spawn my two objects as players but i have one playerControllerId. If i put an abitrary value to the second playerControllerId, i got a warning message like that:" ClientScene::InternalAddPlayer: playerControllerId higher than expected: 10"

    I'm new with this Unity networking engine, and advice will help me,

    thx,

    clerg0

    ps: sorry for my bad english
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    call ClientScene.AddPlayer() on the client with different controllerIds for each player. Then OnServerAddPlayer will get called for each one.