I have code in a .dll that a game in unity3d uses to connect to the server. and for some reason when the code in unity3d uses the code in the .dll it says object refernce no set to an instance of an object. Why is it throwing this error? im declaring everything before using it.
Edit* The reason im posting this is i cant find anything that would be causing this error nothing is null so please help and not complain iv tried searching but i cant find anything that shows what would be throwing the error.
code in .dll
public void Start(string IP,int Port)
{
try
{
keyHandeler.create();
TcpClient socket = new TcpClient();
socket.Connect(IP, Port);
st = socket.GetStream();
Connection(true);
}
catch { Connection(false); }
}
code in unity3d
Client server = new Client();
void Start ()
{
server.Start(IP, Port); // throws the object reference not set to an instance of an object
// other stuff after this but it never reaches them
}