i have seen people struggle with path finding often here on the forum so i have decided to make my astar module available for every body to use.
to get the version that fits the version of blender you use follow this link astar module
how to use it
import Astar astar = Astar.Astar() # addNode(id,position) , the id needs to be a unique string # and the position needs to be a list [x,y,z] # always add ALL the nodes first before anything else. astar.addNode("a",[0,0,0]) astar.addNode("b",[1,0,0]) astar.addNode("c",[2,0,0]) # addLink(from id, to id) # addLink makes a link between 2 nodes in one direction # this makes it possible to make a one way path # ( example would be path that's go over a cliff but no path back up.) astar.addLink("a","b") # and in the other direction astar.addLink("b","a") astar.addLink("b","c") astar.addLink("c","b") # and if you want a node to have a higher cost use # setCost(id,value) astar.setCost("b",10) # this is not going to do much in this small example! # and finely to get a path use # getPath(id, id) # getPath returns a list result = astar.getPath("a","c") # the result would be [ [0,0,0], [1,0,0], [2,0,0] ] # some other function that might be useful is # enable(id) # disable(id) # a disabled node is excluded in the path-finding.