Global Dictionary For All Clients

I am trying to share the share the data of player1 to player2 and data of player2 to player1.
I made a dictionary to add player actor nubmer as a key and player data as value. when running my dictionary length is 1 for each client but it should be 2 for each client because I am adding my 2 clients data into it.

here is my code :

[PunRPC]
void StoreData()
{
foreach (Player player in PhotonNetwork.PlayerList)
{

if (player.ActorNumber == PhotonNetwork.LocalPlayer.ActorNumber)
{

userData.Add(player.ActorNumber, playerData);

}

}

infoText[0].text = userData.Count.ToString();
}

userData.Count.ToString(); is always 1 for each client. Please help me and let me know what to do?
Sign In or Register to comment.