Spherical world

Example scene which demonstrates pathfinding on spherical worlds and other strange shapes.

The scene contains one spherical world, and one box world. Two agents exist at the start, but you can create more by pressing the P key. Local avoidance is also enabled in the scene, so the agents will avoid each other, even on these non-planar worlds.

Graph setup

For spherical worlds, a navmesh graph is really the only option. Neither grid graphs, nor recast graphs can be automatically generated on a spherical world, or any other shape that is not at least somewhat planar.

This scene has two navmesh graphs, one for a sphere, and one for a collapsed box shape. These navmeshes have been modelled by hand in a 3D modelling application, and then imported into Unity.

Movement scripts

This example uses the AIPathAlignedToSurface movement script, to allow it to move on the spherical navmesh.

You can read more about this here: Movement scripts.