Pathfinding 2D Top Down Shooter

Hello,

So far I’ve just been getting the transform.position of my turrets and sending the enemies to these locations. The problem is that enemies will not walk around one another to attack the turrets. I hoped the rigidbodies attached to the enemies might push around one another, but this doesn’t consistently work.

There are very few obstructions on the map, so all I really need is for the enemies to completely surround the turret, rather than bunching on top of one another.

Could someone recommend an asset (free), or suggest the logic for a simple solution? Thanks

If i understand the problem, and that you want the enemies essentially not to “overlap” each other. Then one possible solution would be to look into Steering behaviors, particularly the Separation behavior. This behavior aims to provide a small steering force that will cause agents to move away from each other when in close proximity, helping to avoid situations where they overlap. If combined with other steering forces, steering behaviors should provide a nice versatile solution for your enemies movements.