Error "This part should never be reached" with GraphUpdateScene

I have a strange situation.

I have a LayeredGridGraph and I use a couple of GraphUpdateScene instances to change tag, walkability and penalty on a node. In my current case, bottom and top of a ladder.

The node at the bottom and top of the ladder are traversable, but you can’t stop on them, only move over them - I use a tag for this. That way if the player enters a trigger I know they actually want to use the ladder. There is a NodeLink2 between the 2 nodes but I have not really found another good way to use the link traversal (I’m using AIPath). Better ways to handle ladder situations more than welcome but I think I encounter a strange - unrelated? - bug.

I sometimes get a “Error: This part should never be reached” depending on the number of GraphUpdateScene objects. Sometimes with 3, sometimes with 2, depending on what they alter.

It looks like sometimes the to node is null on Path.CanTraverse(from,to) line 479.
This is with a ConstantPath.

Somewhow it’s related to the Modify Walkability setting. I had it active and set the walkability to active explicitly. If I disable updating the walkability, the error goes away. In this case that’s a valid workaround because walkable would be the default anyway.

Hi

Which version of the package are you using?

Sorry, forgot to mention. This is with the latest 5.0.2.

Hi

Do you have a more precise stack trace, perhaps? Specifically, the one including the CanTraverse method that you mention?

You may also be interested in using the new FollowerEntity movement script, and taking a look at Off-mesh links - A* Pathfinding Project

This is a screenshot of the stacktrace:

I’d love to try the FollowerEntity but unfortunately I use the Ultimate Character Controller to use the npcs and haven’t figured out yet how to make it work with the new implementation (5.0 - using replacing MovementUpdate when using FollowerEntity

Hi

I haven’t been able to replicate this.
If you can replicate it, I’d be very interested if you could share a small example scene showing the issue.

Hi,

Trying to replicate in a separate project and scene takes a bit more time than I currently have, but I did some more testing by toggling stuff on and off, trying to get to the basic minimum.

It’s a LayeredGridGraph (the only one in the scene).

I now have the problem with only a single GraphUpdateScene, and it occurs as soon as I introduce a second layer.

I made some screenshots:

Grid config

GraphUpdateScene
This is attached to a monobehaviour with a boxcollider that would make the node unwalkable without the GUS. So I use the separate GUS to set the nodes walkable again. I manually call the apply method.
I played around with different settings, but it’s really the “walkability” that does it.

** Scene view**
On the right is the GUS. On the left is the 2nd plane. As soon as I activate the top boxcollider so the 2nd layer comes into play, the error occurs.

There’s no other GUS objects in the scene, and the position of the object doesn’t make a difference either.

image

Unity version is 2022.3.18f1, and 5.0.2 AI Path.

I hope this helps already. If not I’ll see if I can reproduce it from scratch in a separate project somewhere in the next couple of days. I’ll also try updating to 5.0.3 first.

Thanks. That would be very helpful.
I’ve tracked down similar bugs before, and they always depend on the tiniest details.