Instructions/Documentation for OpSetCustomPropertiesOfActor

carmine
carmine ✭✭
I want to use properties for players, but I can't find any documentation on this function. If I google for it, only 2 pages come up (and they are unanswered forum messages on here).

Can anyone help out with a simple example?

Basically I'm trying to do something like this
public void SetPlayerTeam(PhotonPlayer player, string team)
{
Hashtable hash = new Hashtable();     
hash.Add("team", team);
PhotonNetwork.networkingPeer.OpSetCustomPropertiesOfActor(player.ID, hash, true, 0);
}

And then later on get the team of the player... it just seems to always be blank..
Thanks!

Comments

  • If you download the regular SDK you will find informations on it in the CHM if I recall right.
    PUN doesn't contain any as its nothing thats exposed to the PUN layer, and hooking it in with set makes no sense as there is no callback exposed thats called upon receive of an update etc
  • We now exposed these features better in PUN 1.9.
    Get it from the Asset Store and have a look at the PhotonPlayer and Room classes with their SetCustomProperties() methods.

    Hope this helps.