Search Unity

OnSerializeNetworkView not called

Discussion in 'Multiplayer' started by woistjadefox, Oct 24, 2014.

  1. woistjadefox

    woistjadefox

    Joined:
    Oct 24, 2014
    Posts:
    11
    Dear Community

    I have an authoritative server network scenario in which the server instantiate the player objects of the other clients. The clients send only the input of their movement via RPC and the server is synchronizing the transform state with the build-in state-synchronization to the clients.

    Now the clients can receive & send RPC calls over the player script and they also get the update of the transform from the state synchronization, but the OnSerializeNetworkView event is never called in the player script. I tried it with a simple Debug.Log to see if anything happens there.

    Code (CSharp):
    1. void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) {
    2.  
    3. Debug.Log("OnSerializeNetworkView was called...");
    4. }
    Neither the client nor the server ever trigger the event. The player objects all have a NetworkView Component and they all observe their own transform.

    Any ideas why the OnSerializeNetworkView event won't be called?
    I need it to manipulate the behavior of the transform movement.

    Cheers
     
  2. woistjadefox

    woistjadefox

    Joined:
    Oct 24, 2014
    Posts:
    11
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    It is in some documentation but probably a bit convoluted.
    See "Observe MonoBehaviour" (e.g.) in our Feature Overview.
    Sorry for the confusion. Glad you found it.