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
1
Question by DanteRiux · Mar 13, 2012 at 06:08 PM · networkingmultiplayernetworkonline game

Need help with basic networking

Hello there. Im sorry to bother. Im kinda frustrated with unity networking, as I found that the examples, guides or even the m2h guide dont work or has errors on unity 3.*. I dont know about the m2h updated version as I cant afford U$s85 for a tutorial. Its probably a great thing, just out of my possibilities. I looked at youtube examples, 3rd party sites and most link in the unity community answers, but I cant find answers to what I need. I would like a simple basic guide to connecting 2 computers (server and client). I dont want things done, I would like to understand and learn what I need to do. Sorry I bothered and here's hoping that someone can throw some light to the matter.

P.s. I want to use unity's built in functionality and classes. I dont want to use smartfox or any other third party solution.

Thanks. I hope someone has any answer for me.

Comment
Add comment · Show 1
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 DanteRiux · Mar 13, 2012 at 11:35 PM 0
Share

Well first of all, many thanks for the fast replies. I am now checking s$$anonymous$$mis videos. As I said I already have that m2h old version and cant afford the U$s 85 for a tutorial. I though I was clear (again sorry if this sound rude, its not my intention at all, I really appreciate that all of you took the time to try and give me a hand). Well I will try to make something out of all that. One other question that Im struggling with is, I want to create a server, but it shows my private ip so my example works only when I test it locally.

here is the code Im using.

var remoteIP = "127.0.0.1"; var remotePort = 25000; var listenPort = 25000; var useNAT = false; var yourIP = ""; var yourPort = "";

function Update () { }

function OnGUI () { // Checking if you are connected to the server or not if (Network.peerType == NetworkPeerType.Disconnected) { // If not connected

           if (GUI.Button (new Rect(10,10,100,30),"Connect"))
           {
            
            // Connecting to the server
            Network.Connect(remoteIP, remotePort);
           }
               if (GUI.Button (new Rect(10,50,100,30),"Start Server"))
               {
                
                // Creating server
                Network.InitializeServer(32, listenPort,useNAT);
                
                // Notify our objects that the level and the network is ready
                for (var go : GameObject in FindObjectsOfType(GameObject))
                {
                 go.Send$$anonymous$$essage("OnNetworkLoadedLevel", Send$$anonymous$$essageOptions.DontRequireReceiver); 
                }
               }
  

// Fields to insert ip address and port remoteIP = GUI.TextField(new Rect(120,10,100,20),remoteIP); remotePort = parseInt(GUI.TextField(new Rect(230,10,40,20),remotePort.ToString())); } else { // Getting your ip address and port ipaddress = Network.player.ipAddress; port = Network.player.port.ToString();

GUI.Label(new Rect(140,20,250,40),"IP Adress: "+ipaddress+":"+port); if (GUI.Button (new Rect(10,10,100,50),"Disconnect")) { // Disconnect from the server Network.Disconnect(200); } } }

But if tested on the net it doesnt work. $$anonymous$$aybe Im doing something wrong. I believe it must be something with useNat.

I dont have a public IP, so there must be my issue.

Any hints will be great =). Thanks anyway up to this point.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Hamesh81 · Mar 13, 2012 at 07:32 PM

Steamis50's youtube channel has quite a large number of Network related videos (and others also). It is quite a long tutorial series but as far as I know the most comprehensive and free one available. Check it out here. You'll have to work out his strange video naming convention but most of the network stuff is back to back. Enjoy, and give me a shout if you find any better material!

Comment
Add comment · 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
0

Answer by Meltdown · Mar 13, 2012 at 06:13 PM

Check this out...

http://forum.unity3d.com/threads/29015-UniKnowledge-entry-Unity-Networking-the-Zero-to-Hero-guide

He has an improved version on the asset store, but it seems a free version in the thread you can download, which should be enough to get you started.

Comment
Add comment · Show 3 · 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 Hamesh81 · Mar 13, 2012 at 07:26 PM 0
Share

that link has been dead for some time now

avatar image Meltdown · Mar 13, 2012 at 07:57 PM 0
Share

The latest post in that thread has an updated download link. http://www.mediafire.com/?5qtuxk1j9gqodi9

avatar image Hamesh81 · Mar 13, 2012 at 08:02 PM 1
Share

How sneaky! $$anonymous$$y bad you're right, someone's 'sharing' $$anonymous$$ike's old guide. Hopefully he's ok with that as I'd say there's a reason why he took it down haha. Thanks for the link!

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

6 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Unity networking tutorial? 6 Answers

Help with server creation and handling. 0 Answers

Networking Player Nametag 1 Answer

Can i make multiplayer game without unity multiplayer service ? 1 Answer


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