h8man / NavMeshPlus

Unity NavMesh 2D Pathfinding
MIT License
1.81k stars 209 forks source link

CalculatePath always return PathInvalid. #175

Closed Scheshi closed 11 months ago

Scheshi commented 11 months ago

Hi. There is a case when NavMesh.CalculatePath always returns the PathInvalid status. At the same time, the usual SetDestination works. What could be the reason for this behavior?

h8man commented 11 months ago

NavMeshPlus doesn't execute any pathfinding. NavMesh.CalculatePath unity's native component

Scheshi commented 11 months ago

Is there any analogue then to get the whole way in 1 frame?

h8man commented 11 months ago

NavMesh.CalculatePath works for me every time. I'm just saying NavMeshPlus has nothing to do with pathfinding, its all about Mesh generation. And I have no knowledge more than unity documentation.

Try looking help on forum or try other solutions like A*

Scheshi commented 10 months ago

I figured out what the problem was, if anyone is interested: My map consists of pieces, the Z position is different for everyone. It turned out that the agent is simply unable to enter the navmesh, the Z position of which is greater than 2, no matter what the height of the agent or the height of the step I would not set. After I set the Z position of all the pieces of the map to 0, CalculatePath worked without any problems.