Photon Unity 2 Teams

Options

Hey, I want to make a game but I don't know how to do it, if I join the room and start the game and be in the scene with the map. This is when there will be two buttons, Team 1, Team 2, or red and blue. And if you click Team 1, it will respawn in the place of Spawn 1 and with the prefab of the player of team 1. But if it joins team 2, it will respawn in the place of Spawn 2 and with the prefab of the player of team 2. Each team has 1 person. anyone know how?

Answers

  • Tobias
    Options

    There are a components and classes in the PUN 2 package, that contain "team" in their name. Have a look at them. This should help separate players into teams.

    How to spawn them at some specific place is up to your game logic, really. At least us Photonians can not help with the UI, sorry.

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options

    Hi @naciox,

    Thank you for choosing Photon!

    I wanted to add that the main component Tobias is referring to is "PhotonTeamsManager".

    You can read its own XML documentation or search more about it here on the forum.

    Besides, there is a good YouTube series that makes use of this here.