A* Pathfinding Project
4.2.3
The A* Pathfinding Project for Unity 3D
|
Brief overview of the different movement scripts in the package.
There are several movement scripts included in the package. These are the scripts that actually move some object in your scene along a path, usually a character of some sort. The movement scripts primary role is to take care of searching for paths and following them.
These scripts are completely optional in this package, you can use pathfinding without using a movement script, or you can write your own movement script. However for many games they provide a nice base to build your characters on, even if you perhaps later in development replace them with something specifically tailored for your game.
There are three included movement scripts in the package AIPath, RichAI and AILerp. The names of the scripts could in hindsight definitely have been chosen better, but I'm hesitant to change them at this point as a large quantity of support material and forum posts refer to these names.
The primary differences between the movement scripts are:
In short, if you are using a navmesh-based graph: use the RichAI script, otherwise use either AIPath or AILerp depending on what kind of movement style your game needs. Check out the example scenes included in the package to see how the different movement scripts behave.
All movement scripts included in the package implement the Pathfinding.IAstarAI interface. So if you need something that can interact with several different movement scripts, this is a nice interface to use.
For example these are some properties which you may find useful (these properties exist on all movement scripts):
If you want your character to follow a specific object you can use the included script AIDestinationSetter. This will behind the scenes simply set the destination property every frame to the position of your chosen target.