I have problems building p3recastnavigation, PandAI is …em… well not for me, and my own previous attempts at pathfinding are a bit meh… so I’ve made something new.
This time the idea is to model a navigation mesh - that is any mesh at all that resembles the walk-able area of your level - and the script will build a graph such that a node is created for each triangle and connected to other nodes in the same way that neighbouring triangles where connected.
Once you have a graph, run A* on it to find a path.
In the code there’s also something to actually move along the found path and something else that smooths the path out, but that’s just a bonus thing. In a real game it would be best to run some collision detection and keep actors on the surface and out of walls.
Code:
github.com/wezu/p3d_astar_nav
It would be nice if someone would test it with some custom mesh to see if/how it explodes, that’s all I’m asking in return (unless you know how to fix my shadows)