Installation

This page shows you how to install the package.

Contents

Installing using the Unity Package Manager

If you install the A* Pathfinding Project using the package manager (https://www.arongranberg.com/astar/download_upm) then all dependencies are handled for you automatically. Nothing else needs to be done after you have imported the package.

You can optionally import the example scenes from the Unity Package Manager. By default they are not imported.

Installing manually

Usually packages can simply be imported into Unity, however the A* Pathfinding Project has a few dependencies that need to be taken care of.

If you are installing the package for the first time then you can skip these instructions. There is a script that will automatically install the dependencies for you after you have imported the package. However if you are upgrading you need to install the dependencies manually since the automatic installation script will not be able to run if there are compiler errors in the package (which there will typically be if there are some missing dependencies).

Before importing the package, open the Unity Package Manager under Menubar => Window => Package Manager. Then you need to find and install the Burst, Mathematics and Collections packages. You also need the Unity UI package, however this is usually installed by default.

After you have done this you can import the package and it should compile without any errors.

Downloading

Make sure you have already installed the dependencies from the previous section. The project can be downloaded from here. You can either download the free version with some limited features (but still very powerful) or buy the pro version which has more cool stuff included.

You can continue with the Get Started With The A* Pathfinding Project tutorial when you have done this.

Installation Errors

Here's a list of errors that you might encounter when importing the package and how to fix them.

"Metadata file 'Library/PackageCache/com.unity.ext.nunit@1.0.6/net40/unity-custom/nunit.framework.dll' could not be found"
This error is caused by a Unity bug. Restarting Unity usually resolves the error.

The type or namespace name 'Pathfinding' could not be found

If the package seems properly installed, this might arise in your own scripts when you try to use the package. This is usually caused by using .asmdef files in your project. You will need to select the one relevant for your script, and add the AstarPathfindingProject assembly as a reference.

Other errors

If you encounter other errors, these are good things to try:

  • Make sure you are using a supported version of Unity.

  • Make sure you have installed the dependencies from the previous section.

  • Try to delete the package, and install it again.

  • Restart Unity.