Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

State synchronization!!!

Discussion in 'Multiplayer' started by roberts, Jul 29, 2008.

  1. roberts

    roberts

    Joined:
    May 8, 2008
    Posts:
    24
    Hello! :)

    Question about state synchronization.

    I will use the Unity networkview in order to synchronize state and not use any more RPC.
    How should I start?
    According to the documentation: in order to synchronize state of some game object - the networkview have to watch some part of game object (e.g. Transform).
    But what is next? If I understund correctly client is moving some game object (networkview is watching changes of state) and networkview is sending changes to the server and finally server to all clients. Right?
     
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    You can make the network view watch a supported component or set up a script which specifically specifies what variables are to be synchronized, see Network.OnSerializeNetworkView. The network view will synchronize at the rate specified by Network.sendRate when using Unreliable synchronization or only when something changes when using ReliableDeltaCompressed (but max the sendRate).

    The owner of the network view does the sending while others receive. See Network.AllocateViewID. You can also customize who receives updates by using Network.SetSendingEnabled and/or NetworkView.SetScope
     
  3. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    603
    Hello Larus

    Is it possible to change the owner of a network view during the game?