I have created a pathfinding script using Roblox's built in pathfinding. The idea is having a bunch of roads and a gps to guide the player. It works great, however if the destination is set far from the player, or around too many curves the pathfinding errors and doesn't create a path. So my question is, are there distance limits to the pathfinding? Does anyone have any ideas I could explore into how to go about going around these limitations if they exist? The map is going to be static with small towns in between so one thought was to find closest city in between the destination and the player until a path is made and then as they get closer redirect them to the new destination, however just because the city is close to the destination city, doesnt mean they are connected by road and it may cause confusion later. Any help would be appreciated.
https://gfycat.com/jovialclutteredbat If you look in the gif at the minimap on the top left, there is no line, but as I walk closer to the intersection the path pops up. Unshown in the console is just the pathfinding.Success == false debug. Once the path is created, I can then move anywhere and it'll keep making the path, even if its in a spot it wouldnt before.
local path = PathfindingService:CreatePath()
path:ComputeAsync(character.HumanoidRootPart.Position, Destination.Position)
if path.Status ~= Enum.PathStatus.Success then
print("Fail")
end
local waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
local part = game.ReplicatedStorage.MapGps:Clone()
part.Position = waypoint.Position
part.Parent = script.Parent.ScreenGui.Map.Minimap
game:GetService("Debris"):AddItem(part,.1)
if i >= zoom/4 then
break
end
end

1 comment
Printing path.Status returns noPath.