How to increase the pathfinding service range

local NPC = script.Parent
local ha = script.Parent:FindFirstChildWhichIsA("Humanoid")
local pathfinding_service = game:GetService("PathfindingService")
local debounce = false
local tabl = {game.Workspace.P1,game.Workspace.P2,game.Workspace.p3}
local Pathrough =  tabl[math.random(1, #tabl)] 
local Prompts = {
	[1] = ("Moving.");
	[2] = ("Heading To Location.");
	[3] = ("Moving To Location");
};
coroutine.wrap(function()
	while wait(2)  do
		print((ha.Parent.HumanoidRootPart.Position - Pathrough.Position).Magnitude )
	end

end)()


while wait(2) do
	local path = pathfinding_service:CreatePath()
	path:ComputeAsync(NPC.HumanoidRootPart.Position, Pathrough.Position, 10000)
	local waypoints = path:GetWaypoints()
	for _, waypoint in pairs(waypoints) do
		if waypoint.Action == Enum.PathWaypointAction.Jump then
			ha.Jump = true
		end
	end  
	for _, waypoint in pairs(waypoints) do  
		ha:MoveTo(waypoint.Position)
		script.Parent.Monsta.MoveToFinished:Connect(function()
			script.Disabled = true
			wait(1)
			script.Disabled =false				
		end)



	end
end

the error is
PathfindingService: path request is too long. - Server - pathfind:22
How do i increase the range? thanks for help

https://developer.roblox.com/en-us/api-reference/function/Path/ComputeAsync

ComputeAsync() only receives two parameters not three, you’ve passed three values as arguments to it.

image
Ok. Ive tried it. But still it says this.
:thinking:

Well, the best solution I can think of is to compute twice, compute 1 time from the start position, and compute again but starting at the last position of the first compute, then merge all the waypoints.

how will i do that? sorry im not that good
:sweat_smile:

Wait i think its just the fact there is no navagation mesh ANYWHERE on the area. I will look at that.