What I am trying to do:
The class “Player” saves the stats for each individual. I am trying to find out the local player’s rank in the match. I do this by making the variable “plRank” equal to the total amount of player’s ingame (this works perfectly fine) and then subtract (–) for each player that has a lower score than the player. For some reason, this value always ends up being “0”. Anybody know why?
[RPC]
void ShowMyKill(string MyName)
{
//MyPlayer.Score += 100;
NetworkManager.GetPlayer(MyName).Score += 100;
NetworkManager.GetPlayer(MyName).Kills ++;
MyPlayer.plRank = NetworkManager.Instance.PlayerList.Count;
Debug.Log(MyPlayer.plRank + " b4 getting rank");
foreach(Player pl in NetworkManager.Instance.PlayerList)
{
if(pl.Score <= MyPlayer.Score)
{
MyPlayer.plRank --;
}
}
GUIManager.Instance.CurRank = MyPlayer.plRank;
Debug.Log(MyPlayer.plRank + " after getting Rank");
}