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.Player.ExternalIP == Unassigned System Address?

Discussion in 'Multiplayer' started by voltage, May 26, 2016.

  1. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    Hey guys,

    So hopefully this is a simple question. I'm trying to display the internal, external IP and port numbers to any of my players for online mode. Network.Player.ipAddress works great for internal and the port is just fine. Whenever I use the code in the title, the external IP won't display. Instead it's 'Unassigned System Address'.

    I tried using Network.Connect(); before calling 'Network.Player.ExternalIP' and I get an error in the console about a Nat facilitator. (I'm assuming this has something to do with the Legacy Networking System).

    Anyways, sometimes the external IP really does show up, but 90% of the time it doesn't. What gives?

    EDIT: Whenever I get the 'Nat Facilitator not connected to target 0' in the console, delete the log and exit the game. Once I re-enter the game, my External IP will display. I don't believe I can fulfill those requirements realistically within the program whenever I want players to see it.
     
    Last edited: May 26, 2016
  2. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    I could create a gui button with 'Application.OpenUrl();', but it looks sloppy for a commercial release. I've searched for the forums and the web for an answer, but I'm not coming up with anything solid. Ideas?