Photon View, Observe

Options
Hi,

I am new in Photon Cloud and I have a problem. I have created a room and other users can login this room, in this part there was no problem. However, there is one GameObject and users will play with this gameobject in turn. However, just user that have created the room can play this object and the others cannot. Users that have just joined the room can play but the other users cannot see changes. How can I solve this problem?

Comments

  • 2Kin
    Options
    For instantiating a gameobject over the network, use PhotonNetwork.Instantiate. This will also buffer the instantiation for players which will connecting later.
    You can also ask the MasterPlayer for particular states of your game (via RPC). As it's the older player in the room, he surely have the historic of all actions.
  • Do you mean that when I create a new room, i create a gameobject with PhotonNetwork.Instantiate?
    I instantiate players with that method and it is ok. However, players play just one gameobject that i create in the beginning of the game.
  • 2Kin
    Options
    Yes, after CreateRoom or JoinRoom you use PhotonNetwork.Instantiate, and then inside your scripts you can see if it's your local player or a remote player with photonView.isMine.
    When your gameobject has finished to instantiate, you can initate your states via OnPhotonInstantiate()