- Home /
Question by
EpicPandaGamer25 · Oct 09, 2015 at 02:15 PM ·
networkingpropertieshashtable
I want to use PhotonNetwork.plaeyr.customProperties
I am working on a team system for my PUN game and I can't figure out how to use custom poroperties. Here is my code:
public void JoinSeekers () {
if (TeamChosen == false) {
Multiplayer ();
TeamChosen = true;
joinh.SetActive(false);
joins.SetActive(false);
crosshair.SetActive (true);
text.SetActive(false);
PhotonNetwork.playerHashtable Team = new Hashtable() {{"Seekers", true}};
PhotonNetwork.player.SetCustomProperties(Team);
TeamWorkaround();
}
}
public void JoinHiders () {
if (TeamChosen == false) {
Multiplayer ();
TeamChosen = true;
joinh.SetActive(false);
joins.SetActive(false);
crosshair.SetActive (true);
text.SetActive (false);
PhotonNetwork.player.SetCustomProperties(new ExitGames.Client.Photon.Hashtable {"Hiders", true});
TeamWorkaround();
}
}
void TeamWorkaround () {
if (PhotonNetwork.player.customProperties["Hiders"] == true) {
SpawnMyPlayer("Hiders");
}
if (PhotonNetwork.player.customProperties["Seekers"] == true) {
SpawnMyPlayer("Seekers");
}
}
Comment
Hello EpicPandaGamer25,
I am sorry, but I also can't help you with this problem because I am new to it.
Did you find a Tutorial for setting up the properties? The only Tutorial I was able to found was one from HammerLabs "SkyArena" but it costs 25$ to get the Code.
$$anonymous$$aybe you can give me an starting Point to get into this topic?
Best regards, SchChris