[This is preliminary documentation and is subject to change.]

The path corridor provides a way of moving along a navigation path without worrying about the minutiae of managing the path.

Core Class: PathCorridor

In the simplest scenario, a path is a list of waypoints from a starting point to an end point. The waypoints form a connected set of line segments along which a navigation client moves. But navigation is much more complex in the real world. There are locomotion limitations, local steering restrictions, dynamic obstacle avoidance, and good old floating point errors. All of these issues can make management of a path difficult.

Navigation based on a polygon mesh provides a different abstraction than just a list of waypoints. The path returned by the NavmeshQuery class is a list of polygons. Technically, a client can move freely anywhere within this corridor of polygons. If a client strays outside the corridor, then the corridor can be patched up using local searches rather than full path replanning.

The path corridor is loaded with a path, a start point, and a target point. It is then used to move the navigation client through the corridor. It handles path straightening, constraining the client to the navigation mesh, and adjusting the corridor due to inaccurate client locomotion.

The PathCorridor API is well documented. The only thing worth repeating here is a warning: You can't just initialize a corridor with a path and forget long distance path planning. Since the path corridor class uses local searches to maintain the corridor, attempting to apply large delta movement to the corridor's position or target can result in a malformed corridor. Details are in the API documentation.

See Also