Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Unity Multiplayer 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.