I have multiple instances (enemies) spawning every 5 seconds which when close enough to player rotate towards player to attack. But if player stays still then all the enemies "pile" on top of each other. How can I do it so that if the enemies are within a certain distance from each other, they move away from each other to stop "bumping" into each other.
The enemies is a single sprite with 19 different frames, so that every 5 seconds a random frame/random enemy is created.
Thanks.