Support Forum

Starters Questions - Node Position, Walkable Node, IsPathPossible, ABPath.Construct

Hello,

I have a few beginner questions about the following, Node Position, Walkable Node, IsPathPossible and ABPath.Construct API.

First I have a grid graph which has 3 in Width and 2 in Depth, Node size as 1.

But if get the 0,0 Node world position using “AstarPath.active.data.gridGraph.GraphPointToWorld(0, 0, 0)”. I will get ( -1000, 0, -500), which I have no idea why it is this far off. I thought it is suppose to be (-1, 0, -0.5), why is it off by 1000 times?

Secondly, I make (1,0), (0,1), (1,1) walkable as false, but when I check if there is a path possible, from (0,0) to (2,0), it still returns true. I through I had blocked every possible nodes around (0,0).

Last, I wanted to get the path using ABPath.Construct of the two points, using a callback function. However, the callback never get called to show the path information. Thoughts?

Here is the screenshot of the setup and the script >>
(P.S it is only 1.1MB in size, but I cannot upload it to this post because it is saying it is exceed over 16MB)
https://drive.google.com/file/d/1xEBxbSLbE5TGfGWgUYOOyZ1pFadzhN7w/view?usp=sharing

Derek

Node positions are stored in integer coordinates (the Int3 struct). It is defined in millimeters. You can convert an Int3 to a Vector3 using a cast: (Vector3)node.position.

You are checking that inside the work item. Some cached info has not yet been recalculated. It will be recalculated once your work item finishes. You can call `AstarPath.active.FloodFill if you really want to update it within the work item, but this usage is discouraged.

Did you call AstarPath.SearchPath? See Searching for paths - A* Pathfinding Project