Pathfinding Not Working

I’ve got an issue where NPCs for my game I guess just aren’t recognizing the terrain, and aren’t walking on it. When I turn on the Navigation Mesh, it doesn’t show anything on my terrain whatsoever. NPCs just stand there and continually cycle through trying to calculate paths.

As an update, the pathfinding is returning an error of nil and status is “No Path”. It’s just a grass hill.

I have no idea without the script but meaby check your PathFindingParameters or if thats what its called.

My code is literally just a copy and paste of what can be found in the pathfinding service tutorial on the documentation. Not a single thing is different.

It works fine in other maps, just not this one for some reason.

Could it have something to do with the fact I imported this terrain from a heightmap rather than made it custom?

Could you get a image of the map?

Omg where are the codes???if it is scripting support,u have to send codes

I have already specified that I am using the exact same code as is found here. It’s quite literally just the same, the only deviations being a couple of extra debugging things I added to print the errormsg and path status to try to understand what’s going wrong and where. This appears to be more to do with a navmesh issue than a code issue, especially as the NPCs will work on many other maps I have, but not this one.

This is a screenshot of the map with all my lighting stuff turned off. Green areas are where the NPCs/Animals spawn randomly. This is also with the Navigation Mesh turned on in settings. As you can see, there isn’t one.

1 Like

I have a stupid question but did you remember to set where the npc will go to?

Yeah, I calculate it based on a random point within a radius of the NPC. Works fine in other games, and NPCs move as intended. Here, there’s no navigation mesh and the status always fires as “NoPath”.

does it work on other terrain maps…?

if so, start with a new baseplate, use a plugin to copy and the paste your other terrain in, and see if that works…

Yep, it appears that loading the terrain into a new baseplate map gets the navigation mesh to generate.

But deleting and then reloading the terrain in my current place doesn’t work - the navigation mesh still isn’t rendering.

Moving places isn’t really an option, as a lot of datastore stuff here is binded using the placeID (this is a multi-realm game)

As a small update, it appears I have gotten the navigation mesh to finally start generating a bit by deleting everything in the map and then ctrl+z / undoing it. But, it’s still missing in a lot of areas… but progress is progress!

It appears to generate fully when I remove all of the trees and other props in the map… but that’s not really something I can afford missing out on.

If I manage to get a solution I’ll post it and mark it.

So, I have no idea how, but in a process of deleting and re-adding props everything began working as intended.

I wish I could give better advice or a better solution for people coming across this issue… but I genuinely don’t know what I changed, if anything.

probably a roblox issue lol. .

1 Like

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