Support Forum

Going from GraphNode to co-ordinants

Is it possible to go from a GraphNode object and get the co-ordinants within the graph?

Hi

You can use

var gridNode = graphNode as GridNode;
let x = gridNode.XCoordinateInGrid;
let z = gridNode.ZCoordinateInGrid;

See https://arongranberg.com/astar/docs/gridnodebase.html#XCoordinateInGrid