Two NetworkManager, one for the Server and one for the Client, Mistake?

Basically i’m new to Unet.
I was trying to not have the Server unity instance also as a Player.

What i’ve done is:
Have two builds of the game, one with a bool “Server” one triggered and one not.
What the bool does if it’s triggered it loads “ServerScene” where there is only a NetworkManager and there is an automatically call of “StartHost()”.
If the bool is not triggered the Scene to load is just what the player must do, passing from “LoginScene” to “CharactherSelectScene” then a “LoadingScene” that loads my map (of course not automatically, by buttons!).

The “Login” scene contains a NetworkManager, then a button to do the StartClient() and it works! I’m able to connect to my Server.

But i’m having problem with spawning now! So the first question, before i ask help about spawning is: is this the correct way to have a Server that is not also the client? Or i just messed around?

Many thankses in advance!

You can use StartServer instead of StartHost, that way you will have only server instance, without client;

Btw, building login system on the Unet HLAPI is a bad idea.

1 Like

I will surely use StartServer, thank you!
The login is all made in PHP, With Unity i just use the WWW class to send data from Input Fields.

So is this the correct way to achive that? Have a ServerScene and a NetworkManager specific for the Server Build?
Thank you for your answer :smile:

There is no way to it in “correct” way. It depends on what you’re doing, and what you’re trying to achieve. If it works for you - then it’s fine.

1 Like

Yeah i mean this can work or it’s just broken at the start? Ahah it’s that that i don’t understand.