Hey there,
I am new to unity and I have being follow a networking tutorial on the unitycookie website and i seem to be getting an error even tho my code is the exact same as in the video. I am using version 3.4.2f3. The error i am getting is
MissingMethodException: Method not found: ‘Network.InitializeServer’.
Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher ()
Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create ()
Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object args)
Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object args)
Boo.Lang.Runtime.RuntimeServices+c__AnonStorey12.<>m__6 ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object args)
UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object args, System.Type scriptBaseType)
Network.startserver () (at Assets/Network.js:17)
Network.OnGUI () (at Assets/Network.js:31)
Here is my code.
var button_X:float;
var button_Y:float;
var button_W:float;
var button_H:float;
function Start()
{
button_X = Screen.width * 0.05;
button_Y = Screen.width * 0.05;
button_W = Screen.width * 0.1;
button_H = Screen.width * 0.1;
}
function startserver()
{
Network.InitializeServer(32, 25000, !Network.HavePublicAddress);
}
//Messages
function OnServerInitialized()
{
Debug.Log("Server Initialized");
}
function OnGUI()
{
if(GUI.Button(Rect(button_X, button_Y, button_W, button_H), "Start Server"))
{
Debug.Log("Starting Server");
startserver();
}
if(GUI.Button(Rect(button_X, button_Y * 1.2 + button_H, button_W, button_H), "Refreash Host"))
{
Debug.Log("Refreashing");
}
}
I would appreciate Any help!