How to compare multiple players that are using the same type of actor?
Lets say you wanted to make a online first person shooter game and used a integer variable to keep track of score. And after a certain amount of time you wanted to give the player with the highest score a weapon, how would you go about getting that actor alone?
Right now the score value is stored in my actor, And I'm trying to compare them in my gamemode.
Also would it be more optimal to save it to a playerstate/player controller? But even then how would you get the highest value of them and compare it?
Score is typically a PlayerState variable.
The logic to select the maximum score is something like this:
Of course you can handle separately if the PlayerArray is empty, you can avoid checking the first element by starting with index 1 (
Follow this question
Once you sign in you will be able to subscribe for any updates here