Hi there, i´m currently making a multiplayer game, and i want the player to create a server and join that server immediately. As it is now, the player hosts a server, opens up another instance of the game and joins there.
Creating and joining is currently working.
//The player hosts a server after typing in the name of the server and Port he wants to use default port is 25600
if(creating = true)
{
Network.InitializeServer(8,Connection_Port,false);
}
// The player starts an extra game instance and joins, after typing in the IP and Port to connect to. Default is IP: 127.0.0.1, Port: 25600.
if (Joining = true)
{
Network.Connect(Connect_To_Ip,Connection_Port);
}
But this does not work:
//The player Creates a server after choosing Servername and Portnumber.
if(creating = true)
{
Network.InitializeServer(8,Connection_Port,false);
Network.Connect("127.0.0.1",Connection_Port);
}
ive got “Network.connections.Length” to show and is only counting 1 if i join with another instance. No errors occurs.
Getting this error: “The connection request to 127.0.0.1:26500 failed. Are you sure the server can be connected to?”