Using Vector3.Distance for an A* heuristic?

Hi,

I’ve been trying to make an A* type of pathfinding system, and am having some doubts about how the heuristic works.

From what I read the heuristic is the shortest path from a node to the final target node. In this case, It should be possible to use Vector3.distance to get the heuristic for each node. I never see it being mentioned as a possible heuristic tho.

So I’m asking here, could I use Vector3.distance as a heuristic? Or will this give inaccurate or simply wrong results?

No, the Vector3.distance would be the manhattan distances.

The A* function to know the path is f(n) = h(n) + c(n,m) where h is the manhattan distances and the c is the cost past from node n to the m.
This function must be make to all the possibles nodes and then go for the minor f(n) cost, and go on until you find the goal.

This is a fast explanation for A* I hope would be helpful. Also you can try LTRA* o IDA* which have less computation cost.