Google is committed to advancing racial equity for Black communities. See how.

Quickstart for AR Foundation

AR Foundation is a cross-platform framework that allows you to build augmented reality experiences once, then build for either Android or iOS devices. A default version of AR Foundation is automatically installed along with the ARCore Extensions for AR Foundation SDK.

The ARCore Extensions package provides additional ARCore functionality for the AR Foundation framework. Here, you’ll learn how to get started with ARCore Extensions for AR Foundation.

Prerequisites

To develop with ARCore Extensions for AR Foundation, you will need Unity 2019.4.3f1 or later. Unity Hub helps you manage different versions of Unity. Download it if you have not already done so.

Requirements

ARCore Extensions requires the following:

Android

Hardware

  • An ARCore supported Android device
  • A USB cable for connecting your device to your development machine

Software

iOS

Hardware

Software

Install a non-default version of AR Foundation

ARCore Extensions for AR Foundation officially supports the ARCore XR plugin on Android and the ARKit XR plugin on iOS. Follow these steps to install a different version. You can also check the Unity manual for a migration guide.

Android

  1. Open a Unity project, or create a new 3D project.
  2. In your project, open the Build Settings. Select Android and click Switch Platform.

  3. Navigate to Window > Package Manager.

  4. Next to Packages, select Unity Registry.

  5. In the search bar, type "AR Foundation".

  6. Select the desired version and click Install.

iOS

  1. Open a Unity project, or create a new 3D project.
  2. In your project, open the Build Settings. Select iOS and click Switch Platform.

  3. Navigate to Window > Package Manager.

  4. Next to Packages, select Unity Registry.

  5. In the search bar, type "AR Foundation".

  6. Select the desired version and click Install.

Install the ARCore Extensions package

The ARCore Extensions for AR Foundation add functionality to Unity’s AR Foundation package, enabling you to use features such as Cloud Anchors, Camera configuration filters, and Recording and Playback in your app. You must have Unity 2019.4.3f1 or later or later installed to use the ARCore Extensions for AR Foundation.

Follow these steps to install ARCore Extensions for AR Foundation.

  1. Download the latest arcore-unity-extensions-*.tgz from the ARCore Extensions for AR Foundation releases page on GitHub.
  2. Open an existing project in Unity, or create a new 3D project.
  3. Navigate to Window > Package Manager.
  4. Click the button and choose the Add package from tarball... option from the drop-down menu.

  5. Locate the arcore-unity-extensions-*.tgz on your machine, then click Open.

You should now see “ARCore Extensions” installed.

Install platform-specific plugins

The AR Foundation package presents an interface for Unity developers to use, but doesn't implement any AR features itself. To use AR Foundation on a target device, you also need separate packages for their respective platforms.

Android

A default version of the ARCore XR plugin is automatically installed along with the ARCore Extensions for AR Foundation SDK. You do not have to manually install the plugin yourself. Follow these steps to install a different version. You can also check the Unity manual for a migration guide.

  1. In your project, navigate to Window > Package Manager.

  2. Next to Packages, select Unity Registry.

  3. In the search bar, type "ARCore XR plugin".

  4. Select the desired version and click Install.

iOS

The ARKit XR plugin allows you to build augmented reality apps for iOS devices. Follow these steps to install it in your Unity project if your application targets iOS devices. When possible, use the same version as the AR Foundation package to avoid any compatibility issues.

  1. In your project, navigate to Window > Package Manager.

  2. Next to Packages, select Unity Registry.

  3. In the search bar, type "ARKit XR plugin".

  4. Select the desired version and click Install.

Configure Player Settings

Android

  1. Navigate to File > Build Settings to open the Build Settings window.
  2. Click Player Settings.
  3. Apply the following changes:

    Player Settings > … Value
    Other Settings > Rendering Uncheck Auto Graphics API
    If Vulkan is listed under Graphics APIs, remove it as Vulkan is not yet supported by ARCore.
    Other Settings > Package Name Create a unique app ID using a Java package name format.
    For example, use com.example.helloAR.
    Other Settings > Minimum API Level If you are building an AR Required app, specify Android 7.0 'Nougat' (API Level 24) or higher.
    If you are building an AR Optional app, specify Android API Level 14 or higher.
    Other Settings > Scripting Backend Select IL2CPP instead of Mono to allow ARM64 support to be enabled in the next step.
    Other Settings > Target Architectures To meet the Google Play 64-bit requirement, enable ARM64 (64-bit ARM). Leave ARMv7 (32-bit ARM) enabled to support 32-bit devices.

iOS

  1. Navigate to File > Build Settings to open the Build Settings window.
  2. Click Player Settings.
  3. In the Inspector window, open the Other Settings menu.
  4. Configure the following settings:

    Setting Value
    Player Settings > Other Settings > Bundle Identifier Add your app's name in a reverse DNS format.
    For example, use com.mycompany.myapp.
    Player Settings > Other Settings > Camera usage description Enter a description to explain your use of AR (for example, ARKit).
    Player Settings > Other Settings > Target minimum iOS version 11.0 or higher
    Player Settings > Other Settings > Architecture ARM64