PathfindingService: path request is too long

I am getting an error while using
path:ComputeAsync
Error: PathfindingService: path request is too long
Since it’s from Roblox, I do not know what to do. Do I replace it with a simple WalkToPoint?
Has anyone come up with a better solution?
Does this mean the request timed out? I would suppose this function has a timeout on it and if it errors it would return nil instead of throwing errors all over… At least a more detailed one.

What exactly are you computing? It’s often better to create your own waypoint system in place of pathfinding, especially for long paths that would otherwise take a lot of cpu power to calculate.

1 Like

I made a general module that makes NPCs walk from start to end points and doesn’t timeout. After every 5 sec, if magnitude is over a given number then it takes the NPC’s current position and the original end position and starts again to make the movement seem smooth.
Because I have multiple NPCs in game and they all go their different ways I do not know which one is causing issues or if this is even a certain one and not all of them. It happens rarely and not on all servers.
Thanks for the answer. Do you have an example of a post on creating a waypoint system? The game is live and I’d rather do as less experiments with the code as possible :grimacing:

–it does timeout after a given time, oops. I forgot it was added (because of stack overflow, SAD).

sec edit: I will use moveto/walktopoint for now as a solution but would really like to read more about a way points system and how to make it efficient.