Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Jebediah · Aug 21, 2013 at 07:35 PM · c#errornetworking

Unity Networking Errors

I cannot seem to get the unity networking thing to work correctly. When I start a start a server and try to connect to it, it gives me the error: NAT target 127 not connected to NAT facilitator 25.181.197.205:50005. I have searched all over unity answers for the fix. I tried creating my own master server and facilitator, turning NAT off, and changing the connection IP to various other IP addresses that may have worked, all to no avail. Please, if anyone has fixed this problem share your solution. Here is my server and client code:

 if (Network.peerType == NetworkPeerType.Disconnected) {
             
             // host server
             hostName = GUI.TextField(new Rect(Screen.width * 0.7f, Screen.height * 0.7f - Screen.height/10 - 60, Screen.width/7, 20), hostName);
             GUI.Label(new Rect(Screen.width * 0.7f - 41, Screen.height * 0.7f - Screen.height/10 - 60, Screen.width/7, 20), "Name: ");
             
             comment = GUI.TextField(new Rect(Screen.width * 0.7f, Screen.height * 0.7f - Screen.height/10 - 40, Screen.width/7, 20), comment);
             GUI.Label(new Rect(Screen.width * 0.7f - 63, Screen.height * 0.7f - Screen.height/10 - 40, Screen.width/7 + 63, 20), "Comment: ");
             
             connections = GUI.TextField(new Rect(Screen.width * 0.7f, Screen.height * 0.7f - Screen.height/10 - 20, Screen.width/7, 20), connections);
             GUI.Label(new Rect(Screen.width * 0.7f - 80, Screen.height * 0.7f - Screen.height/10 - 20, Screen.width/7 + 100, 20), "Max Players: ");
             
             port = GUI.TextField(new Rect(Screen.width * 0.7f, Screen.height * 0.7f - Screen.height/10, Screen.width/7, 20), port);
             GUI.Label(new Rect(Screen.width * 0.7f - 30, Screen.height * 0.7f - Screen.height/10, Screen.width/7, 20), "Port: ");
             
             try {
                 port1 = int.Parse(port);
                 connections1 = int.Parse(connections);
             } catch {
                 GUI.Label(new Rect(Screen.width * 0.7f + 100, Screen.height * 0.6f - Screen.height/10 - 20, Screen.width/10, 80), "Port and Max Players Must be Integers");
             }
             
             if (GUI.Button(new Rect(Screen.width * 0.7f, Screen.height * 0.7f, Screen.width/5, Screen.height/5), "Make Server")) {
                 
                 Network.InitializeServer(connections1, port1, true);
                 
             }
             
             // join server
             portToConnect = GUI.TextField(new Rect(Screen.width * 0.2f, Screen.height * 0.7f - Screen.height/10, Screen.width/7, 20), portToConnect);
             GUI.Label(new Rect(Screen.width * 0.2f - 30, Screen.height * 0.7f - Screen.height/10, Screen.width/7, 20), "Port: ");
             ip = GUI.TextField(new Rect(Screen.width * 0.2f, Screen.height * 0.7f - Screen.height/10 - 20, Screen.width/7, 20), ip);
             GUI.Label(new Rect(Screen.width * 0.2f - 20, Screen.height * 0.7f - Screen.height/10 - 20, Screen.width/7, 20), "IP: ");
             
             if (GUI.Button(new Rect(Screen.width * 0.15f, Screen.height * 0.7f, Screen.width/5, Screen.height/5), "Join Server")) {
                 try {
                     Network.Connect(ip, portToConnect);
                 } catch {
                     failed = true;
                 }
             }
             if (failed) {
                 GUI.Label(new Rect(Screen.width * 0.2f - 30 - 50, Screen.height * 0.7f - Screen.height/10, Screen.width/7, 20), "Unknown Server");
                 Debug.Log("Failed");
             }
         }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Seizure · Aug 21, 2013 at 08:40 PM

In Unity3D GOTO: Edit -> Project Settings -> Editor

In the inspector window: WWW Security Emulation Setting Host URL: (your server's ip address)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jebediah · Aug 22, 2013 at 07:08 PM 0
Share

I have just now tried that and got the same error message, but thanks for the help.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

"Strange behaviour may occur" when using Network.AllocateViewID() 0 Answers

Choose Player UNet Problem with Client 0 Answers

Distribute terrain in zones 3 Answers

Why is networkbehaviour underlined in green? 1 Answer

Server still sending Packets to inactive clients and throwing errors. How can I stop it? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges