Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Mirror NetworkManager.StartClient not connecting

Discussion in 'Multiplayer' started by xeonheart, Jun 17, 2021.

  1. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    114
    Hello,

    So i have been trying to view the youtube tutorial from Dapper Dino:


    I am closely following it, however for some reason, my client is unable to connect to the host, I have added a fail safe, IF the ipaddress string is empty, blank or null, then default to localhost, but when I try it, it gives warning message:

    KCP: Connection timed out after not receiving any message for 10000ms. Disconnecting.

    and then it says: Shutting down client... not sure if I am missing something?
     
  2. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    114
    So i am thinking of going a different route... maybe use the Network manager, but call on the functions? i did try to call on the NetworkManager function StartServer() and StartClient(), had issues connecting from another app with StartClient().... is there a different method i need to call if I am another app joining as a client?
     
  3. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    114
    ohh ALSO, how can I HIDE or not show that Network Manager interface? maybe just hide it in the background while my custom buttons call the functions?
     
  4. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    114
    any help at all?? still trying to use the tutorial, and still not able to connect the client to the server... has anyone had any success with this tutorial?
     
  5. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,954
    Check out our Discord, lots of people help each other out there.
    Most of the team is only in discord, I think it's just me checking the forums here sometimes.
     
  6. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    114
    I gotya, big thank you, what is the discord info? good news, i did figure it out thanks to the comments from the Dapper Dino, BIG thank you to stefan429, he is right, well the things he mentioned in his comment: if youre having issues, MAKE SURE:
    1. your networkManager has the roomPlayer prefab assigned at the bottom
    2. youre using path instead of name for checking the active scene in both OnServerConnect AND OnServerAddPlayer in NetworkManagerLobby, i.e. SceneManager.GetActiveScene().path

    so for number 2, in detail, in the youtube tutorial, it shows:
    Code (CSharp):
    1. if(SceneManager.GetActiveScene().name != menuScene) { conn.Disconnect(); return; }
    BUT you need to change it to:
    Code (CSharp):
    1.  if(SceneManager.GetActiveScene().path != menuScene) { conn.Disconnect(); return; }
    that fixed the problem...
    ONE LAST thing I am trying to figure out, is my lobby, the RoomPlayer prefabs never show up on the Left side that shows the tree and the objects... not sure why :(
    Show less






    REPLY
     
unityunity