Unity3d Photon character movement not synchronous

I am beginner to photon on unity3d. I want to move character synchronously in a game. I am attaching script as an observer to the photon view and using this code

void OnPhotonSerializeView(PhotonStream stream,PhotonMessageInfo info)
{
if (stream.isWriting)
{
Debug.Log("writing");
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);

}
else
{
Debug.Log("reading");
this.correctPlayerPos = (Vector3)stream.ReceiveNext();
this.correctPlayerRot = (Quaternion)stream.ReceiveNext();
}
}
The problem is that the player who creates the room can change the position and rotation of player, it can only write. But the second player(who joins the rooms) cannot change the position and rotation,it can only read. What can be the problem with my setup.

I have followed the marco polo tutorial(http://doc.exitgames.com/en/pun/current ... marco-polo) for this. Any help is highly apperciated.

Comments

Sign In or Register to comment.