In Recreating Example 2 we cover creating the Recast NavMesh Query. Next we’ll create a DetourActor.

  1. Select the StartPoint game object.
  2. Click Component -> Recast -> Detour Actor
  3. Drag the EndPoint Game object to the Target.
  4. Click GameObject -> Create Other -> Capsule
  5. Drag the Capsule onto the StartPoint and set its X,Y,Z position to 0,1,0
  6. Run the program

At this point, the Detour Actor will look for an exiting RecastNavMeshQuery and will begin asking for directions to move to the EndPoint game object. As you move the EndPoint game object it will update and try to get to the new position.

If for some reason the EndPoint is no longer on the NavMesh, the Detour Actor will move as close as possible to the new point.