- Home /
Question by
agentperrys · Dec 29, 2014 at 07:31 PM ·
networkingbugnetwork
Network.Connect Fails To Connect
I'm making a Script that will scan for servers on LAN so the user wont have to type in the IP themselfs. But i have run into an error. OnFailedToConnect() is not called when network.connect cant connect to a server. Code:
//this is where is scans
var ConnectionTries : int;
var IPString : GameObject;
function ConnectToServer () {
ConnectionTries++;
if (ConnectionTries < 1000) {
IP = "192.168.1." + ConnectionTries;
Debug.Log(IP);
var error : NetworkConnectionError = Network.Connect(IP,Port);
Debug.Log(error);
}
}
function OnFailedToConnect(error: NetworkConnectionError) {
Debug.Log("failed");
}
Comment
Your answer
Follow this Question
Related Questions
OnDisconnectedFromServer ignores inheritance 1 Answer
UNET "no free events for message" when client pauses game. 2 Answers
RPC sync issues 0 Answers
Can you create a Stand alone server for your game? 0 Answers
Unet network message or Command/RPC 0 Answers