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

Network : Problem to connect my server

Discussion in 'Scripting' started by BenouKat, Jan 28, 2013.

  1. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi,

    I'm a bit beginner on UNity Networking, and i try to simply connect two instance of my project though the net. I don't want to use Master Server, and i don't want to use local adresses (my goal is to make a multiplayer mode in my game).

    For initialize the server i use :

    Code (csharp):
    1. Network.InitializeServer(8, 25000, !Network.HavePublicAddress());
    On the client instance, it use :

    Code (csharp):
    1. Network.Connect(serverIP, port);
    (serverIP and port are of course completed with my server ip/port)

    The server is okay, but when i try to connect my client, it cant connect (error : The connection resquest failed). I trace the function "TestConnection" of Nework class on my client app, and it returns "LimitedNATPunchtroughPortRestricted".

    In fact, i dont have a public ip adress, so the "useNat" parameter is sitting to "true". It changes something ?

    Do i forget something ? There's something i don't understand in unity networking ?

    Thanks a lot :)