Pathfinding on terrain doesnt work at all

So I was making a pathfinding for npc on standard roblox terrain, and noticed that roblox doesnt render any navigational meshes for them. I found this weird but didnt think much of it, but now when I got the pathfinding done, I found out that for some very unknown reason, it just wont pathfind on the terrain.
For demonstration, here is picture with the terrain and obstacle I want the npc to pass through:


And here are parts representing the path, placed on baseplate underneath:

I tried removing the baseplate, but it just did a weird path path on top of the obstacle:

This behaviour is really weird, maybe its an engine bug, but there is no post about this whatsoever.

I use default roblox pathfinding service of course, here is a simple module I use for the path:

local PathfindingService = game:GetService("PathfindingService")

local pathfind = {}

pathfind.GetServerPath = function(startPos, endPos, pathArgs)
	local path = PathfindingService:CreatePath(pathArgs)
	
	local success, errorMessage = pcall(function()
		path:ComputeAsync(startPos, endPos)
	end)
	assert(success)
	print(path:GetWaypoints())
	if success then return path end
	
	return nil
end

return pathfind

Any help will be appreciated!

1 Like

So, your terrain isn’t generating a navigation mesh, seems to be the same bug i had some time ago, i assume you generated this terrain automatically?

i found a “fix” for the problem, while not a solution for the bug itself, it works.

Link to my post.

(if yhis works, you’re lucky i saw the post, you wouldn’t find anything related anywhere else)

1 Like

You are indeed right that the terrain was automatically generated, but drawing the terrain by hand did not fix the issue.

It wouldn’t fix the issue, read the post and my comment, i explained everything i know about it and what i did to fix it.

I have already read your post, and I am telling you it doesnt fix my issue. I didnt generate lava/bedrock, and painting over the bottom or whatever doesnt change a thing

How tall is your terrain, also try making a single hole through it, top to bottom, and see if it updates the Navmesh.

1 Like

I just found out that my terrain is actually much deeper than I thought. Sorry for the trouble!

1 Like

No problem, glad to see my solution worked for someone else (and that i was not the only unlucky guy out there, lol)

ngl, i should probably report this asap.

Also, would you mind telling me if you’re using any Plugins, and which? might help in case it’s related, seeing that we are the only two cases known ATM.

I actually ran it on clean roblox studio instance just to be sure, it didnt change anything so I doubt that any plugin would cause the issue. I hope they will fix it soon

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.