Hi, I’m not sure what I’m doing wrong, but I’ve got the authoritative version built and the only slight differences are that I have a singleton-like object that is used for checking input (i like to keep input checking modular and separate instead of having scattered input checks throughout my code). I’ve also had to add the network view to the prefab via code in it’s Awake because unity won’t let me drag via the inspector for some reason. (I actually prefer the code to dragging, less the artists can screw up).
These two adjustments should not effect any of the network code.
Anyway, only the server player can move. I’ve tried various combinations of using the editor, built exes, and browser builds just in case there was some sort of network and/or input confusion with the programs running on the same machine.
I’d like to send you my project so you may look at it. It’s likely just a slight typo, I’ve followed your tutorial(s) from top to bottom of this page. The first couple worked out fine, but then the last 2 I was only able to move the server player.
Hmm… I can’t seems to use any function like Network.InitializeServer(…) in C# Script. Is it because I’m developing an iOS app, using Unity iOS Basic? Or is there some mistake I’m doing? I can use the Network classes in Javascript though…
Great Tutorial! Easy to understand and follow!
I’ve got some questions:
1.Right now, the code doesn’t include a way to destroy a player’s cube when he disconnects. I think I should use the function OnPlayerDisconnect() to trigger the removal of his cube but I’m not sure where to put the “Destroy Cube” function. Should this function be an [RPC]?
2. If I’m a client and I disconnect and reconnect to the server, the number of cubes that instantiates under my control keep increasing everytime. E.g: 3 cubes instantiate at once of my 2nd connect. Why is that and how can I fix it?
I’m looking forward to the 2nd part of this tutorial 😀
Comments
This is the most sane, clearly written unity networking tutorial I’ve come across. Thanks very much 🙂
Hi, I’m not sure what I’m doing wrong, but I’ve got the authoritative version built and the only slight differences are that I have a singleton-like object that is used for checking input (i like to keep input checking modular and separate instead of having scattered input checks throughout my code). I’ve also had to add the network view to the prefab via code in it’s Awake because unity won’t let me drag via the inspector for some reason. (I actually prefer the code to dragging, less the artists can screw up).
These two adjustments should not effect any of the network code.
Anyway, only the server player can move. I’ve tried various combinations of using the editor, built exes, and browser builds just in case there was some sort of network and/or input confusion with the programs running on the same machine.
I’d like to send you my project so you may look at it. It’s likely just a slight typo, I’ve followed your tutorial(s) from top to bottom of this page. The first couple worked out fine, but then the last 2 I was only able to move the server player.
Here is a link to download my project:
http://www.gordonjennings.net/temp/test.zip
Between 8am and 4:30pm (GMT-4) you can contact me at: gordon.jennings@armyelearning.ca
Outside of those hours you can contact me at: gordon@gordonjennings.net
You’re help is much appreciated.
I think you need to finish them up… just keep going throught the tutorials. The last script is what you are looking for.
i completely agree with the first comment thank you very much!
This was really useful in learning unity networking with C#, Thank you very much 😀
This was really helpful, thank you, but I can’t seem to find part 2 (the link on the post only leads to part 1), any help?
This is great, however, where is part 2, as i was hoping to see this as a fps (as thats where im having problems) Thanks again though, good article
Sorry my brain is so slow but how would you send rotation details over the network can someone show me ?
Hmm… I can’t seems to use any function like Network.InitializeServer(…) in C# Script. Is it because I’m developing an iOS app, using Unity iOS Basic? Or is there some mistake I’m doing? I can use the Network classes in Javascript though…
ignore the previous post, it was just some silly mistake I made, it works fine now
This is probably the best networking tutorial on Unity3D C#, can you finish it with Masterservers and NATpunchthrough?
Great Tutorial! Easy to understand and follow!
I’ve got some questions:
1.Right now, the code doesn’t include a way to destroy a player’s cube when he disconnects. I think I should use the function OnPlayerDisconnect() to trigger the removal of his cube but I’m not sure where to put the “Destroy Cube” function. Should this function be an [RPC]?
2. If I’m a client and I disconnect and reconnect to the server, the number of cubes that instantiates under my control keep increasing everytime. E.g: 3 cubes instantiate at once of my 2nd connect. Why is that and how can I fix it?
I’m looking forward to the 2nd part of this tutorial 😀
thanks a lot, was really helpful.
Thanks!!! Very, very thanks. A clear and nice tutorial about networking 🙂