Pathfinding Question

I want to optimise pathfinding, so my question is

Do I have each NPC run their own pathfind / ComputeAsync

or

Have a master script that runs one ComputeAsync for every NPC (let’s say with a certain tag)

1 Like

The second option is good if you have lots of NPCs in clusters, like zombies. You can add code to re-use paths when the start and end are similar, or just tell the NPC to follow a nearby NPC that already has a similar path.

1 Like

I agree, the second option seems optimal, but I struggle with understanding how to implement it.

If you could provide an example, I’d appreciate it.

1 Like