Please/thanks for any help with this one: I have a script that is meant to run one path going across a map made of squares, from one numbered spawn point to one exactly across of the same number. The paths that are being ran are saved into that array you see ‘finalPaths’, which is of the size of the width of the A* grid. The squares ‘terrainSqs’ in the code are a 2D array of a class which is just meant to represent each node in the grid. The squares are of the exact same size and number of squares as the grid, everything is the same size, proportionally the squares are 2 units just like the graph squares in Unity distance. The squares even have their position (which is a Vector3) set to the Int3 positions of each node in the A* grid (and yes, it’s divided by 1000 when it’s set). The program waits till all paths are complete before moving on.
Here’s the most important part: the code here used to work, and worked perfectly for a long period of time before (I suspect) updating A* recently.
So before, when I would run these paths, I would see that (after they all finish) the first path’s first GraphNode (which I cast to a GridNodeBase, so I can see the XCoordinateInGrid), that XCoordinateInGrid would correspond to the position of the square I thought it was running from. The first path would start at XCoordinate in grid 0, the next 1, the next 2. And they would all go to the opposing number correctly as well: opposite side 0, opposite 1, etc.
Now however, there is for some reason multiple paths, sometimes as many as 4 or 5 that end up being ran starting from the same starting square more than once. Like, I will go through the array, which has its initial loop supposed to ABPath.Construct from each index up ONCE only, there will for instance be 3 paths that come from XCoordinateInGrid 7. The ending positions also do not even match, they are again just nodes nearby. And there are multiples like 100% of the time too.
Why is A running paths from adjacent GraphNodes when I am telling it to run from the position of a specific GraphNode? Typically it looks to me like I am running a path using the Vector3 position of what I think is GraphNode at X, but it uses nearby X coordinates now 100% of the time.
Here’s a last shot of me logging the Vector3 positions of each square in my project, and its corresponding Int3 / 1000: as we go up the width of the graph, so you can see the position should be close enough (I thought?)