AIPath - After 6+ instantiations, objects run around in circles toward targetPoint

Hello! I’d first like to say that A* Pathfinding is a fantastic product, and I’m glad to see it so well supported.

The problem I’m having is that when I instantiate (or drop) 6 or more of my Enemy objects that use AIPath, they seem to just go screwy; they travel towards their target (which is set to the Player, so its always changing), but they will periodically stop, turn around and move away from the Player along the same path. This creates a Cirque-du-Soleil effect where the seem to move around in little circles. They work just fine when there’s only 1-5 Enemies in existence.

The Enemy objects are very simple, just box colliders, so they are moved via transform.Translate w/in AIPath. They also contain the Simple Smooth modifier. Here’s what I’ve figured out so far in case it will help:

-It does not matter how far or close the objects are to each other.
-I can have 3 Enemies close by, and instantiate 10 more on the other side of the map; the 3 close by start dancing in circles, along with the new 10. I have even scattered them throughout the map and they still exhibit the strange behavior.
-They stop and turn around in time with the Repath rate.

My best guess is that every time they Repath, they try to move to a previous point on an old path. I have Closest On Path Check set to true. Thanks for taking the time out to read this, and help out. :slight_smile:

Graph built on a Unity Terrain
12,091 nodes
3433 walkable
8658 unwalkable
Node size: 10
Aspect Ratio: 1

Cut Corners: true
Connections: Eight
Max Slope: 20
Erode Iterations: 0
Erosion Using Tags: false

Collider Type: capsule
Diameter: 3
Height/Length: 4
Offset: 0

Repath Rate: 0.5
Can Search: true
Can Move: true
Speed: 50
Turning Speed: 5
Slowdown Distance: 0.6
Pick Next Waypoint Dist: 2
Forward Look: 1
End Reached Distance: 0.2
Closest On Path Check: true

Starter End Modifier-
Priority: 2
Add Points: false
Exact Start Point: Original
Exact End Point: Original
Use raycasting: false
Mask: Everything
Use Graph for Raycasting: false
Valid Tags: Everything
Both Tag Penalties and Modifier Priorities have not been changed, much like everything else. Most everything is default.

Fixed it: upped the Next Waypoint Distance to 5 (from default of 2), which I believe solved the problem because of my grid size.