- Home /
Networking questions
Hello!
Recently I have been feeling like my last few questions weren't receiving much help, and I'm feeling a little disregarded. But I thought I'd give this a shot because I have nowhere else to go.
First of all, 1/2 times I build the game to test the networking, I hit the join button and it doesn't even process. It just thinks the UI button does nothing almost. Then, in the editor window if I do the same thing I get either the error that the request timed out, or if I hit it too much it says only 16 hosts allowed. I am not spawning hosts I'm spawning player clients with
manager.StartClient ();
Even if the IP and port are correct it still does not work. This only happens when playing on 2 computers. I'll run it on the computer I'm editing on as a built version, and I'll run it on my laptop. For some reason I can join on my desktop but I can only host on my laptop.
I think this has to do with the variable "Local Player Authority" on the network ID component, or the network manager's component "Multiple Client Mode:".
When I select multiple client mode, it seems to fix, but I have to manually reset it to true because when I run the game it turns off.
Another question.
I'm starting to question what a network transform really does. I'll see a set of enemies on my screen and they're in completely different places on the other computer, so are they really syncing? Not only that, but the visualization of bullets and the syncing of animation are not working. And yes, I did add a network animator to the mesh.
Anyways, I hope my questions can finally be answered. I'm really struggling with this network stuff, so thanks, cheers!
There's a lot of detail missing from your question... How are you spawning the NetworkTransform? Do they also have NetworkIdentity components? How are you setting the local player authority?
Have you tried following a basic networking tutorial?
@tanoshimi hi,
I'd like to begin by thanking you for taking the time to read this question.
As for the spawning, I do Instantiate, so now that you mention it that could be a problem.
I haven't seen any good tutorials on google, I have tried searching UNET, unity networking, everything. The only thing that comes up is a guy trying it for the first time and that's not much help.
I'm joining with StartClient, and starting servers with StartServer.
I set local player authority true for everything in the inspector.
Googling "unet tutorial" gave me multiple results including
https://www.reddit.com/r/Unity3D/comments/3bvsr1/looking_for_new_unet_unity_51_networking_tutorials/
And of course if you are having problems with a feature then you should go through the manual and api
http://docs.unity3d.com/$$anonymous$$anual/UNet.html
http://docs.unity3d.com/ScriptReference/Networking.Network$$anonymous$$anager.html