Installation Guide

This page shows you how to install the package.

Contents

Introduction

You can either install the package from the Unity Asset Store, or from the package website via a custom package manager registry. Both alternatives work fine, but the custom registry is a bit more robust (until Unity improves their package manager), and it allows you to access beta versions of the package.

Installing from the Unity Asset Store

Note

If you are upgrading from version 4, you must delete your previous installation before upgrading, to avoid conflicts. You may also want to check out the Upgrade Guide.

After you have purchased the pro version from the asset store, you can find it in the "My Assets" tab in Unity's package manager.

Click on "My Assets", find the A* Pathfinding Project and click on the "Import to project" button.

Importing Example Scenes

It is also recommended to import the example scenes. These are confusingly not accessible from the same place in the package manager. Instead, after you have imported the package, go to "In Project", click on the "A* Pathfinding Project [custom]" package (there may be two A* packages in this view), go to the "Samples" tab, and then click "Import".

All dependencies should be imported automatically.

See

Assembly Definitions References, if you are using .asmdef files for your code.

Installing using the Package Manager via a Scoped Registry

You can also install the A* Pathfinding Project using a scoped registry via the package website. This is used to gain access to beta versions, and it's also easier to switch between different versions of the package using this method.

Follow the instructions on the linked page to add the scoped registry to your project, and then you can install the package using the package manager. 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.

See

Assembly Definitions References, if you are using .asmdef files for your code.

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.

See

Assembly Definitions References, if you are using .asmdef files for your code.

You can continue with the Get Started Guide tutorial when you have done this.

Assembly Definitions References

If you are using Assmebly Definition Files (.asmdef) files in your project, you will need to add a few references to be able to use pathfinding from your own code.

Note

If you've never heard of .asmdef files, you are probably not using them, and you can skip this section.

  1. Find all .asmdef files that you use for your code (not the ones in the pathfinding package, or any other unrelated 3rd party libraries).

  2. In the "Assembly Definition References" section, add the "AstarPathfindingProject", "ALINE", and "PackageTools" assemblies as references.

  3. Enable "Use GUIDs" for improved compatibility.

  4. Click Apply.

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.