Photon SetCustomProperties not working for previously connected players
Options
Hi
I have some problem while using SetCustomProperties
The code is like below:
Hashtable playerCountryCode = new Hashtable() { { "CountryCode", "HK" } };
PhotonNetwork.player.SetCustomProperties(playerCountryCode);
PhotonNetwork.JoinRoom(roomName);
3 players connected.
Player1 (First Joined): shows all player's country code properly.
Player2 (Joined secondly): shows Player2 and Player3's country code.
Player3 (Last joined): shows only Player3's country code.
I would like to solve this problem. Please help me to get all player's name correctly for all players. Look forward to hearing from you
Here is the attachment
https://pasteboard.co/HZzrtgA.png
I have some problem while using SetCustomProperties
The code is like below:
Hashtable playerCountryCode = new Hashtable() { { "CountryCode", "HK" } };
PhotonNetwork.player.SetCustomProperties(playerCountryCode);
PhotonNetwork.JoinRoom(roomName);
3 players connected.
Player1 (First Joined): shows all player's country code properly.
Player2 (Joined secondly): shows Player2 and Player3's country code.
Player3 (Last joined): shows only Player3's country code.
I would like to solve this problem. Please help me to get all player's name correctly for all players. Look forward to hearing from you
Here is the attachment
https://pasteboard.co/HZzrtgA.png
0
Best Answers
-
did it myself0
-
ok i will
Anyway it was strange.
I just deleted all code and implemented a new code.and it worked.
I really dont know the reason.
But i updated the PUN with the latest version.
I think this solved the problem. but not sure, sorry0
Answers
-
This is PUN Classic?
Do you update the view/display, when new players join? Player 1 should get a callback, when player 2 and 3 join. Each should contain the custom property that each client set before joining the room.
0 -
Hi.
Yes, it's PUN Classic.
Please help me what's wrong...0 -
What does view/display mean, I have a little knowledge, please let me know...0
-
I'm not 100% sure, but looks like your code up there is to remember the country code that is lastly saved.
-1 -
did it myself0
-
Hi @sweetmei25,
It's good that you solved this on your own but it would be better if you shared your solution with others so they can benefit from it in the future.0 -
ok i will
Anyway it was strange.
I just deleted all code and implemented a new code.and it worked.
I really dont know the reason.
But i updated the PUN with the latest version.
I think this solved the problem. but not sure, sorry0