- Home /
Question by
KaidaStudios · Sep 14, 2017 at 10:52 AM ·
networkingmultiplayernetwork.connect
UNet start client at start (Instead of HUD)
I was trying to take out the HUD and just have a client start with the player to spawn, I have a LAN server open already and I get no errors, just the scene with no spawned player.. all works fine with HUD.. any help would be greatly appreciated!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;
public class connectasclient : NetworkManager
{
public NetworkManager m_Manager;
public string IpAddress = "192.xxx.x.x";
public string Port = "localhost";
private bool _started;
// Use this for initialization
void Start () {
NetworkManager.singleton.networkAddress = IpAddress;
NetworkManager.singleton.networkPort = int.Parse(Port);
NetworkManager.singleton.StartClient();
}
}
Comment
Best Answer
Answer by KaidaStudios · Sep 14, 2017 at 07:33 PM
I figured it out.. I was being dumb and not testing all my different code with the server actually on.. xD
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
How many times do I need to check for internet? 1 Answer
Can we use Unitys LLAPI to establish a socket connect with a server? 1 Answer
[Multiplayer] Unable to spawn non-player object using NetworkServer.Spawn() call 0 Answers
How many players does Unity's built-in networking support? 1 Answer