i dont know how to make two armies attack eachother, i would also like if one of blue enemies attack the player (fella on back)
I’m sure there are infinite strategies. Do the characters move? Do they shot and/or battle hand to hand?
You could choose the closest objects either in relationship to themselves or in relationship to the character in the back. Or a random target.
Do you want only one character targeting another character at a time or maybe a maximum number per target?
Once locked on would they continue to attack or would they always choose the closest enemy?
1 question: they are meele
2 question: i want each to have one target at a time
3 question after their battle is over with the current enemy they would choose the closest one to kill
I would use a “for each” line that picks a random number for each blue character or green character. That number would correspond to an enemy for them to target. Then when one enemy is dead, run the number again or just choose the nearest enemy to attack next.