- Home /
How do I make a network?
I know this question sounds rreeallyyy stupid but I don't think the unity documentation has enough info on this subject. I have been working forever and I cannot get a network to work for the life of me. I have managed a connection, but I dont get how to create objects across the network and have different players moving around. Any help?
Answer by syclamoth · Sep 16, 2011 at 04:19 AM
The first thing to remember is that, for any object to be synchronised over the network it needs to have a NetworkView attached to it. Once you have that, there are a few ways to go about object synchronisation, from the most straightforward (using the NetworkView to observe an object's transform) to more complicated solutions, such as writing a script which sends target positions in Network.OnSerializeNetworkView, and then using (networkView.isMine) to check whether the current user is authoritative or not, and interpolating towards the target positions. This solution creates a small amount of latency between the authoritative player and everyone else, but has a very smooth result.
To start with, use Network.Instantiate to instantiate a prefab (just make sure it only happens on one computer!) and see how far you get.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How can I make an in-game search engine similar to Scribblenauts 1 Answer
Why cant i get my animation to play? 0 Answers
PhotonView question 1 Answer
Only activate chat if T is pressed 0 Answers