Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Third Party [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,737
    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.