The problem that I encountered is that when I set player 2's dice SetActive to False, it disappears for the player 1 as well since the PhotonTargets is set to All for the player tokens to move together. Below is the code how I attempted it. Do I even need to code this logic here or should it be somewhere else please ? Thanks in advance
public static void MoveSteps(string playerName, int numberOfSteps)
{
ScriptsPhotonView.RPC("MoveStepsRPC", PhotonTargets.All, playerName, numberOfSteps);
}
[PunRPC]
void MoveStepsRPC(string playerName, int numberOfSteps)
{
print("playerName:" + playerName);
print("numberOfSteps:" + numberOfSteps);
if (playerName == "Player1")
{
GameObject.Find(playerName).GetComponent<PlayerController>().Move(numberOfSteps);
dice.SetActive(true);
}
else if (playerName == "Player2")
{
dice.SetActive(false);
}
}