Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Multiplayer [Photon]Stream always writing

Discussion in 'Multiplayer' started by vselockov, Apr 20, 2019.

  1. vselockov

    vselockov

    Joined:
    May 10, 2018
    Posts:
    10
    In my script photon stream is always writing
    Code (CSharp):
    1. private void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    2.     {
    3.         Debug.Log("writing "+stream.isWriting+" view "+ photonView.isMine+" d_t "+Time.deltaTime);
    4.         if (stream.isWriting)
    5.         {
    6.  
    7.             stream.SendNext(transform.position);
    8.         }
    9.         else
    10.         {
    11.  
    12.             transform.position = (Vector3)stream.ReceiveNext();
    13.         }
    14.     }
    And logs always show double true values. In scene only client player moves, other players don't move
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,724
    Have you tried putting a debug.log statement in the else part of the condition to see if the remote clients are receiving the data?
     
    Joe-Censored likes this.