- Home /
Going from LAN to WAN (UNet Online)
I have some components of my game working such that I can connect from a client operating on my LAN, and have two players.
I want to distribute teh game to a couple testers and get some input on the game so we can play over the internet, but I'm not sure how to proceed nor what to search online tutorial-wise to do this.
Can anyone point me in the right direction to get an internet-ready game up and running?
Thanks!
Answer by nickostan · Aug 26, 2017 at 04:28 PM
This tutorial and the subsequent ones are invaluable!
Answer by Bunny83 · Aug 24, 2017 at 12:11 AM
Unity, like most other games, only use TCP or UDP as protocols. Those build on top of the IP protocol. So you can simply use it either ove LAN or WAN. Just connect to the correct public addresses.
Of course if you're behind a NAT router you have to port forward the post you use to your local computer / device. This has to be done only on the server side. Client don't need to do anything special, just connect to the public IP of whoever hosts the game.
Awesome, thanks for your response. Can you give me a general idea on how to handle the client connecting to the host IP?
Uhm the easiest way is to display an input field where the user can input the server IP. For automatic match making you need some sort of lobby server where all clients connect to automatically. Such a server is usually reached through a fix domain name.
If you actually use UNet you could also use Unity's match making server service. I've never use this myself. You have to create a project over here in order to use the matchmaking service as far as i understood ^^.