Hi there, I’m working in a large maze with one monster that’s designed to navigate and constantly compute a path to the player. The issue is, is that if I am too far from the monster, path.Status returns NoPath. I’ve tested this by setting spawn points incrementally further from the monster within the same accessible path of the maze, and found that at some point of distance, it returns NoPath. I couldn’t find any other post relating to this and wanted for help.
In the image below, the part selected is the spawnpoint
Note: AgentRadius is completely unrelated.
Snippet below:
connection = task.spawn(function()
while task.wait() do
path:ComputeAsync(bot.HumanoidRootPart.Position,hrp.Position)
bot.Nextbot.WalkSpeed = 45
print('CHASING')
for i,v : PathWaypoint in ipairs(path:GetWaypoints()) do
bot.Nextbot:MoveTo(v.Position)
bot.Nextbot.MoveToFinished:Wait()
end
I took one of big mazes I can find in toolbox (Why not) And the pathfinder seems to work smoothly (In far ranges) I’m not sure what’s the issue. You could try using one of the modules I use SimplePath - Pathfinding Module
And check navigation mesh to see if it’s the nav mesh.
Same issue. I even removed the maze and stood from my spawnpoint and it did not pick up. When moving closer to the bot however, it did pick up and startec chasing me
Hm so this is weird. I remade a script for the pathfinding, moved the maze up and re-ran the code with my original bot too. It worked.
local pfs = game:GetService('PathfindingService')
local path : Path = pfs:CreatePath()
local bot = script.Parent
local spawnlocation = workspace.SpawnLocation
path:ComputeAsync(bot.PrimaryPart.Position,spawnlocation.Position)
print(path.Status)
for i,v : PathWaypoint in ipairs(path:GetWaypoints()) do
bot.Humanoid:MoveTo(v.Position)
bot.Humanoid.MoveToFinished:Wait()
end
I may have to experiment with pathfinding more, I don’t wanna make bunch of words since I’m using a phone right now but, Does pathfinding really only working around baseplate height? (Default map)