AIPath will not move agent when following path created by ABPath.FakePath()

  • A* version: 5.3.1
  • Unity version: 2022.3.31f1

I have a use case where I need some units to follow a specific path drawn by the player and saw that FakePath looks exactly like what I need. However, upon implementing it, the agent will not move at all. Implementation below in screenshot:

pic2

I tried to see if taking the vectorPath from ABPath and then passing it into FakePath will work (in case I’m somehow generating the list of points incorrectly). However, this still does not work:

If I just pass the constructed ABPath into setPath(), it works. So there is something with AIPath not wanting to work with FakePath. I’m building a 2D game as well if that matters, so the z-value for these Vector3 points are always zero.

Hm, yeah I’d imagine this would just work out the gate-- is the pointsList populated after making a FakePath? Maybe the list is empty? I’d debug it right before the SetPath call.

yep, definitely not empty. I did debug it as well to check if FakePath actually correctly took in the list of points and it did. Path.vectorPath has the correct list of points in it.

The only other thing I can think of is maybe some of the flags in the Path object need to be set? I saw there’s one to check if path has finished calculating for example. Will test manually changing some of these flags.