Enable ARCore

This page describes how to enable ARCore functionality in your Unity projects. To do this, you need to:

  1. Get the ARCore Extensions package
  2. Create a new project and import the ARCore Extensions package
  3. Configure your app to be AR Required or AR Optional
  4. Make sure your app complies with ARCore's User Privacy Requirements

Get the ARCore Extensions package

The ARCore Extensions for AR Foundation package is available from GitHub:

  1. Download the latest arcore-unity-extensions-*.tgz from the GitHub releases page.

  2. Extract the downloaded archive to a local folder. Make sure it's a location that is convenient -- after you install the package into your project, you won't be able change the folder's location or contents without first uninstalling the package. You may reinstall the package after changing the folder location.

Create a new project and install the ARCore Extensions package

  1. Open Unity and create a new 3D project.

  2. To import the ARCore Extensions package downloaded from GitHub into your project, follow these steps:

    1. Open the Package Manager (choose Window > Package Manager).

    2. In the top left corner of the Package Manager, click the + (plus) button. Choose Add package from disk…

    3. Locate the local folder where you unzipped the archive, and select the package.json file, then click Open.

    4. Wait a moment while Unity installs this and dependent packages into your project.

Configure your app to be AR Required or AR Optional

An app that supports AR features can be configured in two ways: AR Required and AR Optional. If you need help deciding which one to choose, see Publish AR Apps in the Google Play Store.

Make an app AR required

To be usable, an AR Required app requires an ARCore supported device that has Google Play Services for AR installed on it.

  • The Google Play Store makes AR Required apps available only on devices that support ARCore.

  • When users install an AR Required app, the Google Play Store automatically installs Google Play Services for AR. However, your app must still perform additional runtime checks in case Google Play Services for AR must be updated or has been manually uninstalled.

To make an app AR Required:

  1. Create an instance.

  2. Make sure that the Edit > Project Settings > XR > ARCore > Requirement > Required menu item is checked as shown below. It is checked by default.

    Your app will automatically perform runtime checks to make sure that the device supports ARCore and has Google Play Services for AR installed. If the APK is not installed (possibly because it was removed by the user) or the version is too old, your app will prompt the user to install or update. If the install or update fails (possibly due to a network failure), ARSession.ARSessionState will return an error, and your app should handle the error and quit.

Make an app AR Optional

An AR Optional app has optional AR features, which are activated only on devices that has Google Play Services for AR installed.

  • AR Optional apps can be installed and run on devices that don't support ARCore.

  • When users install an AR Optional app, the Google Play Store will not automatically install Google Play Services for AR with the app.

To make an app AR Optional:

  • Check the Edit > Project Settings > XR > ARCore > Requirement > Optional menu item.

Perform runtime checks

If your app is AR Optional, it should check ARSession.ARSessionState upon launch. This checks whether the device supports ARCore and, if so, whether Google Play Services for AR is installed.

Your app should handle these conditions:

Condition Action
Device does not support ARCore. Hides AR-related functionality.
Device supports ARCore, but Google Play Services is either not installed or out of date. Prompts the user to install or update by calling Session.RequestApkInstallation().
Device supports ARCore and Google Play Services for AR is installed and up to date. Creates an ARCore Session and starts using ARCore.

User Privacy Requirements

Make sure your app complies with ARCore's User Privacy Requirements.

Next Steps

Read the code in the sample app and ARCore for Unity API reference.