/// This AI is the default movement script which comes with the A* Pathfinding Project.
/// It is in no way required by the rest of the system, so feel free to write your own. But I hope this script will make it easier
/// to set up movement for the characters in your game. This script is not written for high performance, so I do not recommend using it for large groups of units.
///
/// This script will try to follow a target transform, in regular intervals, the path to that target will be recalculated.
/// It will on FixedUpdate try to move towards the next point in the path.
/// However it will only move in the forward direction, but it will rotate around it's Y-axis
/// to make it reach the target.
///
/// \section variables Quick overview of the variables
/// In the inspector in Unity, you will see a bunch of variables. You can view detailed information further down, but here's a quick overview.
/// The <see cref="repathRate"/> determines how often it will search for new paths, if you have fast moving targets, you might want to set it to a lower value.
/// The <see cref="target"/> variable is where the AI will try to move, it can be a point on the ground where the player has clicked in an RTS for example.
/// Or it can be the player object in a zombie game.
/// The speed is self-explanatory, so is turningSpeed, however <see cref="slowdownDistance"/> might require some explanation.
/// It is the approximate distance from the target where the AI will start to slow down. Note that this doesn't only affect the end point of the path
/// but also any intermediate points, so be sure to set <see cref="forwardLook"/> and <see cref="pickNextWaypointDist"/> to a higher value than this.
/// <see cref="pickNextWaypointDist"/> is simply determines within what range it will switch to target the next waypoint in the path.
/// <see cref="forwardLook"/> will try to calculate an interpolated target point on the current segment in the path so that it has a distance of <see cref="forwardLook"/> from the AI
/// Below is an image illustrating several variables as well as some internal ones, but which are relevant for understanding how it works.
/// Note that the <see cref="forwardLook"/> range will not match up exactly with the target point practically, even though that's the goal.
/// [Open online documentation to see images]
/// This script has many movement fallbacks.
/// If it finds a NavmeshController, it will use that, otherwise it will look for a character controller, then for a rigidbody and if it hasn't been able to find any
/// it will use Transform.Translate which is guaranteed to always work.
///
/// Deprecated: Use the AIPath class instead. This class only exists for compatibility reasons.
/// Target point is Interpolated on the current segment in the path so that it has a distance of <see cref="forwardLook"/> from the AI.
/// See the detailed description of AIPath for an illustrative image
/// </summary>
publicfloatforwardLook=1;
/// <summary>
/// Do a closest point on path check when receiving path callback.
/// Usually the AI has moved a bit between requesting the path, and getting it back, and there is usually a small gap between the AI
/// and the closest node.
/// If this option is enabled, it will simulate, when the path callback is received, movement between the closest node and the current
/// AI position. This helps to reduce the moments when the AI just get a new path back, and thinks it ought to move backwards to the start of the new path
/// even though it really should just proceed forward.
/// </summary>
publicboolclosestOnPathCheck=true;
protectedfloatminMoveScale=0.05F;
/// <summary>Current index in the path which is current target</summary>