Hello, I am currently working on a project, however the documentation does not help much.
How could I make sure that if the players of team 1 dies automatically go to team 2
And also commits to display the number of players in each team.
How to change the player's team as soon as he dies ? And Display the number of players in each team.
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
Hi,
I'll give you what you need to achieve what you described,
You can know the team of the local player with:
you can use to know the current team of the player and decide in which team spawn after die.
You can get the list of all players in a specific team with:
You can use for display the players of each team.
You can change the player team and spawn the player in that team with:
The function called when a player die is located in bl_PlayerHealthManager.cs -> Die(...)
I hope that helps.
I'll give you what you need to achieve what you described,
You can know the team of the local player with:
Code: Select all
PhotonNetwork.LocalPlayer.GetPlayerTeam()
You can get the list of all players in a specific team with:
Code: Select all
var playersInTeam1 = PhotonNetwork.PlayerList.GetPlayersInTeam(Team.Team1);
You can change the player team and spawn the player in that team with:
Code: Select all
bl_GameManager.Instance.SpawnPlayer(Team.Team1);
I hope that helps.