How to create team?(photon)

Hello friend, how to create team and check with collider, i Use punTeam but i do not know verify bullets to apply Damage

Comments

  • Hi @Valakinhas,

    when using PunTeams, the team is stored in the Player Custom Properties and you can compare this value to the other. If the bullet is instantiated by using PhotonNetwork.Instantiate(...) it must have a PhotonView component. This one also contains the owner of the bullet, means that you also have a reference to the owner's team here. Within the collision callback you can access it for example by using other.GetComponent<PhotonView>().owner.GetTeam() and compare it with the team of the hit player.
  • Hi @Valakinhas,

    when using PunTeams, the team is stored in the Player Custom Properties and you can compare this value to the other. If the bullet is instantiated by using PhotonNetwork.Instantiate(...) it must have a PhotonView component. This one also contains the owner of the bullet, means that you also have a reference to the owner's team here. Within the collision callback you can access it for example by using other.GetComponent<PhotonView>().owner.GetTeam() and compare it with the team of the hit player.

    how to set team to minion ?
  • You would have to add other teams on your own by adding them to the PunTeams class. Please note, that this file might get overwritten, when you are updating PUN to a newer version. You can of course also use PunTeams as a pattern for your own implementation of the same functionality.