Finding all nodes in a specific direction from a target, Constant Path?

I’ve been trying to find a way to implement flanking/tactical system that findings all nodes in front of the player limited by a certain distance. At first I thought I could use constant path to generate the nodes and cull ones I don’t want but that doesn’t seem to be working out as I figured. I am using:
queueData.path = ConstantPath.Construct(target.transform.position,_instance.gScore,_instance.OnFlankingPositionComplete);
AstarPath.StartPath(queueData.path);

  1. What and how do you calculate the G Score. I read it’s cost/distance. So assuming a cost of 1 for all nodes in a grid graph, and a distance of 5(node size) would that mean 0.2 would be the G score of adjacent grid nodes? Or am I not seeing something.
  2. How do you convert the position from a GraphNode into a world position? The position on the Graphnode is an int3 which I am assuming is a compressed floating point integer and x,y,z give me very large values…

Hmm…I figured out #2, explicit cast (Vector3) node.position…but I still don’t understand how to set a G score or better yet set distance and from that determine a G score.

Hi

G score is the cost for moving to the nodes. Cost is defined as world distance*1000 (actually Int3.Precision, but that’s a constant set to 1000) + node penalty (which you probably do not use, so it will be zero).

So for a node size of 5, the G score for adjacent nodes would be 5*1000 = 5000.

  1. It has an overloaded conversion operator
    Vector3 pos = (Vector3)myGridNode.Position;