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

Getting started with Extensions for AR Foundation

The optional ARCore Extensions for AR Foundation package adds 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.

Requirements

To develop with ARCore Extensions for AR Foundation, you will need 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 the ARCore Extensions package

Follow these steps to install ARCore Extensions for AR Foundation.

  1. Open or create a new Unity project.
  2. Select the desired target build platform:
    1. Go to Build Settings.
    2. Select Android or iOS, depending on the desired target platform.
    3. Click Switch Platform.
  3. Import the latest ARCore Extensions package:

    1. Navigate to Window > Package Manager.
    2. Click the button and choose the Add package from git URL... option from the drop-down menu.

    3. Paste the following URL into the text field:

      https://github.com/google-ar/arcore-unity-extensions.git
      
    4. Click Add.

When installing ARCore Extensions Unity will also automatically install suitable version of the required dependencies:

  • AR Foundation
  • ARCore XR Plugin (used when targeting Android)
  • ARKit XR Plugin (used when targeting iOS)

These dependencies might not be visible in the Package Manager > Package: In project view. However, the packages can be seen in the Project window under Packages

Setup ARCore Extensions

  1. Right-click the Hierarchy pane to add the following game objects:

    • XR > AR Session
    • XR > AR Session Origin
    • XR > ARCore Extensions
  2. In the Inspector pane, connect each of the following ARCore Extensions fields with their corresponding game objects in the Hierarchy pane, or scriptable objects in the Project pane, by clicking the target button next to each field in the Inspector. See Unity's editing properties documentation to learn more.

    • Session: Use your scene's AR Session.
    • Session Origin: Use your scene's AR Session Origin.
    • Camera Manager: Use your scene's AR Camera, which is a child object of AR Session Origin.
    • ARCore Extensions Config (optional): Create a new ARCore Extensions Config by selecting Assets > Create > ARCore Extensions > ARCore Extensions Config, and select your newly created object. To learn more, see the Cloud Anchors developer's guide (Android, iOS).
    • ARCore Camera Config Filter (optional): Create a new ARCore Camera Config Filter by selecting Assets > Create > ARCore Extensions > Camera Config Filter, and select your newly created object. To learn more, see the documentation on configuring the camera.

What's next

With ARCore Extensions for AR Foundation, you can now use Cloud Anchors and camera configurations in your apps.