- Home /
Photon Networking and Team creation.
Hey Unity Community!!!
I am working with the FPS Kit 2.0 ( 1.2c) in unity to create an Online FPS game for a competition in April, but I have a problem. How do I create a type of team play? Like Red vs. Blue that you have in Halo? I have set up tags in the Editor, and they work, but the scripts that come with the package need different tags(e.g. "Remote"). I am thinking about creating a variable in a script, but how is that synced to other players? Thanks!
To view what I have now, bit.ly/NLGPlayer
Adeola Ayeni
NitroLabGames
Answer by programmrzinc · Mar 10, 2013 at 08:35 PM
I simply created a customProperty when the Player Spawns in the game
PhotonNetwork.player.SetCustomProperty("TeamRed");
Answer by tobiass · Feb 13, 2015 at 01:20 PM
There is a now demo in the PUN package called "Pickups, Teams, Scores". It's in the Demos\DemoPickup\ folder in the project.
The class PunTeams is the core piece for the team implementation here. It extends the PhotonPlayer class with extension methods GetTeam() and SetTeam(). In the background, we set a Custom Property per player which declares which team the player has picked.
Take a look at it's code.
Answer by Barry100 · Aug 24, 2017 at 07:31 AM
the demo dosnt work. I have posted the question on your own forum about this but as yet have not had any interest or reply. Here is a link to the thread