Ok so i am tryeing to connect with a friend to try the game im playing, here is how I make the server.(I know its probably wrong but works on lan connection)
function LaunchServer () {
print(!Network.HavePublicAddress());
var useNat = !Network.HavePublicAddress();
Network.InitializeServer(5, 25000, useNat);
MasterServer.RegisterHost("TimsTestGame", "LevelOne", "I am testing to see if I acan network! Thank you unity!");
}
and connect is just
Network.Connect("192.168.1.140", 25000);
but it only works on LAN not over internet. What IP should i specifically use?
Thanks! But, So when I tried that it just said connection failure and did nit work when I used that IP. This is all testing on my own computer by the way.
I had a lot of problems with unity networking, but everything worked fine when I used a VPS for hosting the masterserver. Even though i did all the portforwarding i needed to do, it was never reliable enough to host from my own computer. Dunno why it was so unstable though.
I tried to port forward it but with no success. Does anybody have any other ideas? I also allowed it in my firewall. The only error it gave just said it could not connect to my IP. Although it did not say it could not find it. Does the person trying to connect also have to port forward?