- Home /
how to make 'Networking Example' connect online
Hey there, I've been testing out the 'Networking Example' pack that Unity offer on thier official site,
(you know, this one; http://unity3d.com/support/resources/example-projects/networking-example.html)
and it seems to work really well localy; I can open a game in 2 browser tabs and have them connect to one another. But when I get a friend to load the game somewhere else, joining over the internet doesn't seem to work. when I (or any of my friends) host the game the text up top says "UNASSIGNED_SYSTEM_ADDRESS" (thats an error? i guess?)
So how do I get this example to work online? are there ports I need to open? special firewall settings or something?
Thanks in advance, Jackson.
Answer by CarlLawl · Oct 22, 2011 at 12:29 PM
I haven't touched the unity example but this will probably be your problem, do you give them your IP address to connect to or is there just a connect button in the game? If you don't have to put an IP in a text field to connect then you probably have an IP variable that is 127.0.0.1 , make a textfield and what ever gets entered set that to your ip variable and use the ip entered to connect to, then when they enter your ip and click connect you should be game!
it already requires an IP to be typed in, then they hit the "Connect" button to join. but that's what's not working :S
www.pastebin.com pop your code on there and ill take a look
Answer by jackson31 · Oct 23, 2011 at 12:15 AM
Oops, I found the solution and now i feel like an idiot. I was looking at the Script Reference for Network.Connect and for it's parameters it need a special ID number called a GUID in order to connect online, I was attempting to use the external IP (since local games worked by typing the local IP into that same box) .
Also, NAT Punchthrough needs to be enabled before hosting, otherwise the server doesn't become visable outside of my local network (that's what that "UNASSIGNED_SYSTEM_ADDRESS" thing was all about I guess)
So to anyone else trying to get this demo to work, it's like this; 1. NAT Punchthrough on (on server machine) 2. Hit 'Start Game' button 3. On client machine, enable NAT punchthough 4. type the leftmost number, from the host game screen (labled "GUID:") into the text box on the client machine 5. Press connect!
Answer by gcgonster · Nov 13, 2011 at 04:01 PM
Hiya, I'm trying to get the same demo working too and did what you said but I'm getting the following in the console:
Sent connect request to facilitator at 67.225.180.24:50005 Connected to facilitator at 67.225.180.24:50005 Doing NAT punch through to 950259719220261543 using 67.225.180.24:50005 Sent connect request to facilitator at 67.225.180.24:50005 Connected to facilitator at 67.225.180.24:50005 Doing NAT punch through to 950259719220261543 using 67.225.180.24:50005 Receiving NAT punchthrough attempt from target 950259719220261543 failed
I read about it and some say I don't have NAT on my home router but it does and it's enabled so I'm not sure why this ain't working.
If anyone could help would be greatful! Thanks
Answer by jackson31 · Dec 08, 2012 at 04:07 AM
I've started a new multiplayer project in unity and now I am getting the same error as gcgonster; "NAT punchthrough attempt from target 950259719220261543 failed" There doesn't seem to be any documentation or details on what this error means / what causes it to happen!
Your answer
Follow this Question
Related Questions
Unity Network Tutorial Master Server Question 1 Answer
Is it good to use unity make a card game? 2 Answers
[Command] not run on host when using relay server 0 Answers
Multiplayer example 2 Answers
Photon switches player's camera 2 Answers