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.
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.
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.
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”.
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.