FollowerEntity creating paths through a spherical world

  • A* version: 5.3.8 (Pro)
  • Unity version: 6

Hi, I’m trying to use the FollowerEntity script on a spherical world and finding that it produces paths that go through the world, e.g., underground, which causes my characters to pass through the terrain.

Below are some screenshots showing the issue -


As you can see, the orange path preview goes through the terrain.

Here is a screenshot from below with the navmesh graphs turned on -

Here is another example -

I think it is then making my characters go under the terrain as they follow the path beneath it -

Screenshot of my settings -

It’s also making it difficult for me to draw a path preview to the user (the green line) as it disappears into the terrain, too.

Is this expected behaviour on spherical worlds, or have I configured something wrong? Any help is appreciated!

I’ve done a bit of further experimenting using a Seeker with the FunnelModifier with the “Split At Every Portal” option set, and it produces the correct path along the surface -


However, when I pass that path to the FollowerEntity via the SetPath method, it still produces a path through the terrain - shown in orange.

Hi

The FollowerEntity will be able to follow the path correctly, however it will give back a path roughly equivalent to the funnel modifier without the Split At Every Portal option set.

This is controlled by the highlighted false parameter here (in the PathTracer.cs script).

Right now there is no exposed way to change it, I’m afraid. Though you could modify the code manually.

Thanks for the quick reply! I had just found that switch myself; however, setting it to true throws a NotImplementedException from here -

Are you sure you changed that boolean in the exact place I indicated? Looks like you changed it in an adjacent location.

Ah, yeah, you are correct. I changed it to the wrong place. This is working as expected now!

Thank you very much!

My characters are still sometimes going through the navmesh, though -



Any ideas on that?

Actually, don’t worry about that. Enabling gravity on the FollowerEntity appears to have resolved it and caused no other issues :+1: