Setting Player Custom Properties and can't get them.

Options
Here is my code:

void OnJoinedRoom() {
PhotonNetwork.playerName = m_playerName.text;

var propsTable = new ExitGames.Client.Photon.Hashtable();
propsTable.Add(Consts.EMail, GameManager.instance.email);
PhotonNetwork.player.SetCustomProperties(propsTable);

analyzePlayerProps();

PhotonNetwork.LoadLevel(Scenes.Park);
}

public static void analyzePlayerProps() {
PhotonPlayer[] list = PhotonNetwork.playerList;

for(int i = 0; i < list.Length; i++) {
Debug.Log(list[i].CustomProperties.Count);
}
}

So each player who joins a room is getting a property. Why in analyzePlayerProps list[i].CustomProperties.Count is always zero? Why there are no properties? What am I missing? Thank you :)

Comments

  • Aaahhh... I got it... GameManager.instance.email is null... And the property just doesn't add. I figured it out by myself.
This discussion has been closed.