Migrating from Unity Navigation
Guide to help you migrate from Unity Navigation to the A* Pathfinding Project.
In this guide, you will learn what Unity components correspond to which A* Pathfinding Project components and what major differences there are.
If you are looking for a comparison between Unity's pathfinding and the A* Pathfinding Project, you might be interested in this page: Feature Comparison.
The overall architecture is not too different, in both packages there are:
Movement scripts, which tell the agent how to move and where it should move.
Graphs, which describe where an agent can move.
Temporary obstacles, which cut holes in the navmesh or update it in other ways.
Off-mesh links, which allow an agent to move or jump between otherwise disconnected parts of the navmesh.
However, the names used differ between the packages.
A* Pathfinding Project
The AstarPath component
NavMesh Agent component
Off-Mesh Link component
The NodeLink2 component
Unity has a single graph type which automatically generates a navmesh. It is very similar to the RecastGraph in the A* Pathfinding Project. If you create a recast graph in this package, its settings will most likely seem familiar to you.
This package has several other graph types, however. For example, grid graphs, point graphs and navmesh graphs.
Read more about other graph types here: Graph Types.
Unity's NavMesh Agent has local avoidance built-in. In this package, local avoidance is instead handled by a separate component called the RVOController. If you attach it to an object which already has a movement script then it will be picked up automatically, and local avoidance will work much like it does with Unity's package. You will also need a single global instance of the RVOSimulator component, which handles all the calculations and has the global simulation settings.
Read more about local avoidance here: Local Avoidance.
AI Properties and methods
When interacting with a movement script, the names yet again differ between Unity's package and this package. Here's a list of the most used properties/methods and their corresponding properties/methods in this package: The IAstarAI interface is referenced here, which is an interface which all movement scripts (e.g. AIPath/AILerp/RichAI) implement.
A* Pathfinding Project
RVOController.priority, but the range is reversed (0 is the lowest priority)