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

Getting Started With ARCore Extensions for Unity's 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.

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.

Install required packages and plugins

ARCore Extensions requires the following:

  • All devices: AR Foundation 4.1.5 or later. This is automatically installed along with the ARCore Extensions for AR Foundation SDK.
  • Apps targeting Android devices: ARCore XR Plugin 4.1.5 or later. This plugin is automatically installed along with the ARCore Extensions for AR Foundation SDK.
  • Apps targeting iOS devices: ARKit XR Plugin 4.1.5 or later. This plugin will need to be manually installed.

Install a non-default version of AR Foundation

The AR Foundation package allows you to work with augmented reality with multiple platforms within Unity. It is required for all target devices. A default version of AR Foundation is automatically installed along with the ARCore Extensions for AR Foundation SDK. This 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.

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.

  1. Open a Unity project, or create a new 3D project.

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

  3. Next to Packages, select Unity Registry.

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

  5. Select the desired version and click Install.

Install a non-default version of the ARCore XR plugin

The ARCore XR plugin allows you to build augmented reality apps for Android devices. A default version of this plugin is automatically installed along with the ARCore Extensions for AR Foundation SDK.

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

Install the ARKit XR plugin

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.

Add AR Foundation objects to your scene

Right-click the Hierarchy pane and select XR to add AR Foundation objects to your scene.

The main objects are:

  • AR Session: Controls the lifecycle of an AR experience.

  • AR Session Origin: Transforms AR coordinates into Unity world coordinates.

  • ARCore Extensions: This object is the central pivot for all Extensions APIs. It handles ARCore sessions and camera configurations, among other things. Session, Session Origin, Camera Manager, and ARCore Extensions Config are required fields.

Next steps