How do I make NPC's that are in swarms

Hello! How do I make a group of NPC’s in swarms and not in a straight line

My problem

Whenever I spawn in a bunch of NPC’s to destroy a building, they always walk in a straight line. Is there a way for them to not walk in a straight line meaning they would bunch up together left and right front and back instead of in a line. Thanks!

2 Likes

An easy solution would be to pick a different random target position somewhere inside the building that the NPC is attacking, instead of having them all target the same position.

A slightly more interesting solution would be to make them behave like boids (good word to google) or something. Basically, add rules to their movement that makes them separate a bit.

1 Like