Text doesnt show info to other player

Options
I have a text which should appear to other remote players but doesn't. I instatiated it with canvas which have a photon view. also the object has photon view. I see only my text
void Update () { nameofplayer=main.playername; cardsofplay=main.playercardsc; if (photonView.isMine){ info.text="Emri "+ nameofplayer+ " Kart "+cardsofplay.ToString();} //if (!photonView.isMine){ // info.text="Emri "+ nameofplayer+ " Kart "+cardsofplay.ToString(); //} } private void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.isWriting){ stream.SendNext(nameofplayer); stream.SendNext(cardsofplay); } else { nameofplayer=(string)stream.ReceiveNext(); cardsofplay=(int)stream.ReceiveNext(); } }

Comments

  • What is the problem exactly? Text is not printed or data is not synchronized between clients?
  • Eduard
    Options
    Data is not syncronise between clients so the see only their text not other text
  • [Deleted User]
    edited August 2015
    Options
    Is your script assigned to PhotonView as observed script?
    Check 'Observed Components' section of PhotonView inspector.
  • Eduard
    Options
    yes sir script is assigned to Photonview
  • Eduard
    Options
    any help
  • Tobias
    Options
    In each Update() every script sets
    nameofplayer=main.playername;

    I don't know what main is, but this is most likely the cause for having the same text everywhere.
    I assume main is providing you with "this clients" input or something?!
    All scripts on anyone's photonViews is using this. Make sure to check photonView.isMine and only change the values, if you own the GO.

    Related: Fight for Control in the Marco Polo Tutorial.
  • Eduard
    Options
    It is all mixed up by me. main shows correct values but text box of opponent remote player isnt syncronised. the text is empty. main has an photonview to send rpc calls.
  • Eduard
    Options
    I have read these materials but nothing. OnSerialiseView is only part that confuse me. Another time Ihave a scene object with photon view that contains main script. I instantiate texbox for each player. using photon instantiate. this prefab has an photonview and an script see above. in this script I check if photonview is mine. Players see only their text. other texboxe are empty. I just want to know how main prevent other players to set updates. Excuse me if I am annoying you
  • Eduard
    Options
    I have use in this case player custom properties. Thank you for help