- Home /
Multiplayer tutorial help
I am using the muliplayer tutorial, and the first code is bringing up some odd errors.
Assets/connectionGUI.js(17,41): BCW0012: WARNING: 'UnityEngine.Network.useNat' is obsolete. No longer needed. This is now explicitly set in the InitializeServer function call. It is implicitly set when calling Connect depending on if an IP/port combination is used (useNat=false) or a GUID is used(useNat=true).
Assets/connectionGUI.js(23,41): BCW0012: WARNING: 'UnityEngine.Network.useNat' is obsolete. No longer needed. This is now explicitly set in the InitializeServer function call. It is implicitly set when calling Connect depending on if an IP/port combination is used (useNat=false) or a GUID is used(useNat=true).
Assets/connectionGUI.js(25,41): BCW0012: WARNING: 'UnityEngine.Network.InitializeServer(int, int)' is obsolete. Use the IntializeServer(connections, listenPort, useNat) function instead
All of these refer to this line:
Network.InitializeServer(32, listenPort);
I have no idea what to do. Any help?
Answer by Jul · Dec 12, 2012 at 03:14 AM
Now you can refer [here][1]. The new way to config use/no use NAT for server.
function LaunchServer () {
Network.incomingPassword = "HolyMoly";
var useNat = !Network.HavePublicAddress();
Network.InitializeServer(32, 25000, useNat);
}
So just remove those line
Network.useNat = useNAT;
and add boolean param to Initial method. [1]: http://docs.unity3d.com/Documentation/ScriptReference/Network.InitializeServer.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612102917im_/https://answers.unity.com/themes/thub/images/avi.jpg)