Issues starting out a project with navigation on a sphere

Hi there, I’m starting out trying to get multiple AIs to navigate the surface of a sphere. Its pretty basic right now, I have a spherical Navmesh and a few Navmesh cuts for obstacles.

I started out using AIPathAlignedToSurface with mixed results. The AI would move, however only one would move at a time, and I keep getting the following exception:

NullReferenceException: Object reference not set to an instance of an object
Pathfinding.AIPathAlignedToSurface.UpdateMovementPlane () (at Library/PackageCache/com.arongranberg.astar@4.3.47/Behaviors/AIPathAlignedToSurface.cs:85)
Pathfinding.AIPathAlignedToSurface.OnUpdate (System.Single dt) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Behaviors/AIPathAlignedToSurface.cs:18)
Pathfinding.AIBase.OnUpdate (Pathfinding.AIBase[] components, System.Int32 count, Pathfinding.Util.BatchedEvents+Event ev) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:471)
Pathfinding.Util.BatchedEvents+<>c__DisplayClass14_0`1[T].<Add>b__0 (System.Object[] objs, System.Int32 count, Pathfinding.Util.BatchedEvents+Event ev) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:150)

I also noticed that while the agent moves in Unity, when I build and run on my android device the AIs don’t move (maybe this is due to the exception?).

Next I tried using RichAI instead of AIPathAlignedToSurface but I can’t seem to get the destination to set. I have the Destination Setter component added, but I don’t see any target listed in the RichAI debug info in the inspector.

Any help on these or where to get started would be greatly appreciated.

Ok, I made some progress. I discovered that the exception was due to not having an RVO controller attached to the AI and an RVO sim in the scene. After adding these I could use AIPathAlignedToSurface with some success.

I am having an issue now with the destination setter. My AIs don’t seem to reach the target I’ve given them, especially if it is on the other side of the sphere. In fact, the destination listed in the debug section of AIPathAlignedToSurface is different from the target I put in DestinationSetter. It almost looks like the AIs find a new target that is on the top hemisphere of my surface that is horizontally aligned with the destination when the destination is on the bottom half of the sphere.

Seems similar to the issue posted here: Game object stuck when traveling on spherical surface - #7 by Thompson

one more update…

I have things working well if I disable Navmesh cuts. I’d really like to use these though.

Hi

Sorry for the late answer.

Navmesh cuts are not supported on spherical graphs I’m afraid. The cutting algorithm is purely 2D, so it’s not possible to use it here.