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

Host does not see the remote player ...

Discussion in 'Multiplayer' started by MornFall, Jul 6, 2015.

  1. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hi all,

    I am trying to replace the NetworkManager and make my own, more for the learning experience than anything else.

    So i have got the Server to start, remote client to connect, set ready, Spawn the remote client player...

    My issue is with the LocalClient, i think.

    I Start the NetworkServer, then i start the localClient like that :
    Code (CSharp):
    1. client = ClientScene.ConnectLocalServer();
    2.         client.RegisterHandler(MsgType.Connect, OnLocalClientStarted);
    3.         client.RegisterHandler((short) 41, new NetworkMessageDelegate(OnLocalServerReady));
    4.         ClientScene.RegisterPrefab(player01Prefab);
    5.         ClientScene.RegisterPrefab(player02Prefab);
    I get the remote client connected, load scene, set itself to ready and send the AddPlayer. Works all good.
    But in my server (Host) :
    1 : I do not see the remote playerprefab... only the remote client has it in the scene.
    2 : If i do the same thing for the localclient (host), the playerprefab does not spawn, and i get no error message, no output... I am certain that the host get the request from the localclient to Addplayer as i have put a print.

    And i am not sure what i am missing right now.