public void SpawnPlayers() { // Iterate through the number of players and assign their spawn points for (int x = 0; x < currentPlayers; x++) { if (x < spawnPoints.Length) { GameObject go = Instantiate(playerPrefab, spawnPoints[x].position, Quaternion.identity); MultiplayerThirdPersonControl player = go.GetComponent <MultiplayerThirdPersonControl>(); player.SetPlayerID(playerIDs[x]); player.SetLayerMask(layerMasks[x]); player.SetDeadState(false); } } }
public void KillPlayer(MultiplayerThirdPersonControl player) { player.SetDeadState(true); currentPlayers -= 1; }