I have created a scene with a single dice where players will click on the dice turn by turn which will change the color of the dice. First I have created a room and a player joined the room and entered the game scene. Till here everything works fine. But when player 1(host) clicks on the dice, player 2 doesn't see the dice moving. I have added the photon transform view in the inspector and here is my code:
void Update()
{
turnBaseGame();
}
public void turnBaseGame()
{
PhotonView photonView = PhotonView.Get(this);
photonView.RPC("OnMouseDown", RpcTarget.All);
}
[PunRPC]
public void OnMouseDown()
{
if (Input.GetMouseButtonDown(0))
{
// color change
}
}
I am clicking on the dice using OnMouseDown function but both player's dice in the game scenes are not synchronizing. I want the dice to show on both screens whenever a player clicks on the dice, the color changes and it should show to other player's screen. Then in the next turn another player will do the same. Please help me to solve this issue. Thanks