Coding combat?

Thanks for the reply, I should have been more specific in the original post :slight_smile:

Combat : Player uses tab which cycles through all the enemies on the opposing team, cast a spell or attack (within range) which will deal damage to enemy target.

To do this I thought about having an array of players which is held in the gameMode and in the class which extends off of Pawn, have it change target depending on position in the array?

so for example (forgive the pseudo code done in 2 seconds :stuck_out_tongue: ):


**GameMode.cpp:**

PlayerPawn players [6];

**PlayerPawn.cpp:**

for (int i = 0; i < players.size(); I++)
{
    if (Target pressed)
       {
           target += 1;
        }
}

if (attack1 pressed)
{
     players[target].takeDamage(20);
}