Upgrading from 4.2.18 to latest beta causes all paths to error

I’ve just upgraded the package from the latest Asset store published version to the latest beta version, the package had been working flawlessly before this. However, now every time I try and calculate a path the path always returns with the same error. This is being done via Seeker.StartPath with tolerance for node availability.

“Couldn’t find a node close to the start point”

Nothing about the config was changed, just a drop-in replacement.

The graph itself still looks good in the Scene view (I am forever grateful for the amazing performance improvement in this area!), all the nodes are green except where they should be showing unwalkable, which they are.

I tried looking at the upgrade guide but it had nothing there aside from ensuring dependencies were installed (which they are).

I’m running Unity 2023.1.16f1.

Could anybody help?

Thanks,
Andrew

Hi

Could you verify that if you do an AstarPath.active.GetNearest(transform.position) request for the agent’s position, you get a node back?
If not, you may have to increase the A* Inspector → Settings → Max Nearest Node Distance.

Thanks for your response.

Calling GetNearest returns null. If I check “Scan On Awake” it returns something. However, every path calculated still fails with the error;

“Searched all reachable nodes, but could not find target. This can happen if you have nodes with a different tag blocking the way to the goal. You can enable path.calculatePartial to handle that case as a workaround (though this comes with a performance cost).”

I set my Max Nearest Node Distance from 25 to 2500 without change.

I cannot actually see calculatePartial on the autocomplete for the Path object either?

Hi

Ok. Scan On Awake is the default. Have you disabled it because you are scanning the graph yourself?

Also are you using any tags or something that could block the pathfinding request? I don’t think there should have been any change in how this is handled in the beta vs non-beta, but it’s good to check anyway.
calculatePartial exists on the ABPath type (see ABPath - A* Pathfinding Project). But if it worked in 4.2.18, you shouldn’t have to enable this.
I’m not sure what could cause this difference in behaviour.

I build the terrain procedurally from code, so I scan after the terrain is built manually (no point scanning on awake as it’s costly and it won’t be used). I can see even with these errors the terrain has been correctly scanned. The nodes that should be unwalkable are so, and the queries being made are achievable.

I have no tags that prevent movement, I have a tag I use for roads that causes a lower penalty than the default to enure they’re preferred over non-roads (the agents get a speed boost on these). However, these errors occur on a new game creation where no roads have been placed yet (meaning nothing will have that tag).

I’m sorry I don’t have anything more useful to report, I’ve just done the upgrade and am left scratching my head.

Very strange. I’m at a loss as to what could be the issue.
Would it be possible for you to share a small example project with me that shows the issue?

I tried to create a small projects with the same settings in the Pathfinder & Seeker but it works fine, so not of much use.

I have created a very simple test inside my existing project/scene;

ScanOnAwake: enabled
Terrain: 1024x1024 - Totally flat - All nodes walkable

Path Start: 0.0/0.0/0.0
Path End: 113.46/0.0/-65.91 (randomly generated within the bounds of the terrain)

Same “Searched all reachable nodes, but could not find target” message.

Do you have a screenshot of the graph, with the two points? Set A* Inspector → Settings → Graph Coloring = Areas.

So the end node property as the path fails is null.

When I call GetNearest() on the end position it returns an NNInfo object that makes sense, and the node contained within that has a position exceptionally close (less than 1 world unit) to the end vector given.

I’ll get you that screenshot now.

The sphere is the start, the cube is the finish. You can see the error message at the bottom of the screen. The blue is the areas showing on the flat terrain.

When exactly do you run the code? During Start? Or during Update?

I actually run it OnEnable, and manually enable it after i’m sure the graph is scanned etc.

Hmm. Okay. That is very strange. I cannot replicate this:

Are you sure your original AstarPathfindingProject folder is deleted?

Yes. It was all contained in a single folder. If I search for “astar” or “path” in my assets it comes up blank (as the beta uses the scoped repo so it sits in Packages, not Assets).

Just to double check. That screenshot was with A* Inspector → Settings → Graph Coloring set to Areas, right?

Yes :slight_smile: Here’s the areas once the terrain has been generated and the graph re-scanned.

From what I can see, nothing should go wrong here, and I can’t replicate this at all.
Would it be possible for you to send me the scene/project with the simple plane?

That’s inside my main project, I couldn’t replicate it inside a new project with a simple scene. I’m not comfortable to send over the project in its entirety (I’m not sure how I would either as it’s massive).

Ok.

In that case, could you send screenshots of the grid settings, pathfinding settings, and the exact code you used? I might be able to replicate it then.