Hi!
I’m really new in Unity, and have stuck on this for a while.
How can i create scenarios, when server and client can change object position, and in both sides object moves. Is it possible using “State Synchronization”.
I created sample application, but one of the application instances (client, server) has to be master.
How can i get that, when one client applications changes object position, then all client applications and server synchronizes this object position. And when server changes object position, then all client applications synchronizes object position.
Do i have to create own my protocol using RPC?
Thanks.
Maris
Hi,
Take a look at Network Views:
http://unity3d.com/support/documentation/Components/class-NetworkView.html
And the MonoBehaviour function OnSerializeNetworkView()
Through either, or both, of these mechanisms, you can synchronize position and other values over the network.
You could also create a protocol using RPC, but these provide an easy mechanism to do this.
Check out the unity networking examples - they provide a pretty good grounding for this.
Good luck!
-BSpline
But in my previous post:
http://forum.unity3d.com/viewtopic.php?t=20432
I was told, that with state synchronization i can control object from one side (server/client)
Sure, in this case you make sure that the master server (the controlling side) has control of the object.
So, say: it is the master that called Network.Instantiate() on the prefab (so it will be the only one able to respond to Input)
-BSpline