AngryAnt Pathfinding multiple enemies following target

I've been having difficulties getting multiple enemies to find a single target and follow the path.

I noticed when I put:

        controller.StartPath(transform.position, Target.position);

In the Awake method all targets will approach the path, but if I move that to the update only the first 3 enemies will approach the target. Putting the above code in both Awake and Start will break it. What am I missing? Has anyone experience a similar situation? Maybe if I run a check on each enemy to see if it's destination is far from the moving target, if so stop the enemy then recalculate path, I'll have more success.

1 Answer

1

I solved my own problem.

I did a distance check on the path endpoint to the target. If the distance was high enough I stopped the enemy and recalculated the path.

yey independant learning. Bravo!