Unity's
[AR Foundation](https://unity.com/unity/features/arfoundation) is a
cross-platform framework that allows you to write augmented reality experiences
once, then build for either Android or iOS devices without making any additional
changes. The framework is available via Unity's **AR Foundation** package.

ARCore's optional
[ARCore Extensions for AR Foundation](https://developers.google.com/ar/develop/unity-arf/getting-started-extensions)
package adds additional functionality, enabling you to use features such as
Cloud Anchors, Camera configuration filters, and Recording and Playback to your
app.

## Migrate or upgrade existing projects

- To migrate an existing project from the (deprecated) ARCore SDK for Unity to Unity's *AR Foundation* and optionally *ARCore Extensions* , see the [migration guide](https://developers.google.com/ar/develop/unity).
- To upgrade an existing project from an earlier version of AR Foundation, see Unity's [upgrade and migration guides](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/upgrade-guide.html).

## Requirements

Depending on your target platform, the **AR Foundation** package requires the
following:

### Android

**Hardware**

- An [ARCore supported](https://developers.google.com/ar/discover/supported-devices) Android device or emulator
- A USB cable for connecting your device to your development machine

**Software**

- [Unity **2019.4.3f1 or later**](https://unity3d.com/get-unity/update) with [Android Build Support](https://docs.unity3d.com/Manual/android-sdksetup.html)

### iOS

**Hardware**

- An [ARCore supported iOS device](https://developers.google.com/ar/discover/supported-devices#ios)
- A USB cable for connecting your device to your development machine

**Software**

- [Unity **2019.4.3f1 or later**](https://unity3d.com/get-unity/update) with [iOS Build Support](https://docs.unity3d.com/Manual/UnityasaLibrary-iOS.html)
- [Xcode **16.0 or later**](https://developer.apple.com/xcode/)

## Install AR Foundation

Follow these steps to install the **AR Foundation** Unity package.

1. Open an existing Unity project, or create a new 3D project.
2. Navigate to **Window \> Package Manager**.
3. Next to **Packages** , select **Unity Registry**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-unity-registry.png)
4. In the search bar, type "AR Foundation".

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/search-ar-foundation.png)
5. Click **Install**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-desired-arfoundation-package.jpg)
6. Configure the Render Pipeline

   ### AR Foundation 4.x

   > [!NOTE]
   > **Note:** Both the [Built-in Render Pipeline](https://docs.unity3d.com/Manual/built-in-render-pipeline.html) and the [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.3/manual/index.html) are compatible with the AR Foundation package, but the latter requires [additional steps](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/ar-camera-background-with-scriptable-render-pipeline.html) to configure.

   ### AR Foundation 5.x

   > [!NOTE]
   > **Note:** Both the [Built-in Render Pipeline](https://docs.unity3d.com/Manual/built-in-render-pipeline.html) and the [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.3/manual/index.html) are compatible with the AR Foundation package, but the latter requires [additional steps](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/manual/project-setup/universal-render-pipeline.html) to configure.

   ### AR Foundation 6.x

   > [!NOTE]
   > **Note:** The default [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.3/manual/index.html) requires [additional steps](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.1/manual/project-setup/universal-render-pipeline.html) to configure. You may switch to the [Built-in Render Pipeline](https://docs.unity3d.com/Manual/built-in-render-pipeline.html) if you want, as both are compatible with the AR Foundation package.

## Install and enable platform-specific plugin packages

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'll also need to install separate packages and enable the
corresponding plugin for each respective platform.

### Android

The [ARCore XR Plugin](https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/manual)
package lets you build augmented reality apps for Android devices.
Follow these steps to install it in your Unity project if your application
targets Android devices. 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**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-unity-registry.png)
3. In the search bar, type "ARCore XR plugin".

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/search-arcore-xr-plugin.png)
4. Click **Install**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-desired-arcore-xr-plugin.jpg)
5. Navigate to **Edit \> Project Settings** . In **XR Plug-in Management** , open the **Android** tab and enable **ARCore**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/xrm-enable-arcore.png)

### iOS

The [ARKit XR Plugin](https://docs.unity3d.com/Packages/com.unity.xr.arkit@4.2/manual)
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. 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**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-unity-registry.png)
3. In the search bar, type "ARKit XR plugin".

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/search-arkit-xr-plugin.png)
4. Click **Install**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/select-desired-arkit-xr-plugin.png)
5. Navigate to **Edit \> Project Settings** . In **XR Plug-in Management** , open the **iOS** tab and enable **ARKit**.

   ![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/xrm-enable-arkit.png)

## Configure an AR Session and add AR Foundation components to your scene

A scene needs an AR session to enable [AR processes](https://developers.google.com/ar/discover/concepts),
such as motion tracking, environmental understanding, and lighting estimation.
You will need the following game objects to support an AR session:

### AR Foundation 4.x


- **AR Session**: Controls the lifecycle of an AR experience.

- **AR Session Origin**: Transforms AR coordinates into Unity
  world coordinates.

Before adding the new game objects, delete the default **Main
Camera** . It will be replaced by a new **AR Camera** in the
**AR Session Origin**.

![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/delete-default-main-camera.png)

Add the new AR game objects to your scene: right-click the
**Hierarchy** pane and select **XR** . Add a
new **AR Session** and a new
**AR Session Origin**
game object.

<br />

### AR Foundation 5.x


- **AR Session**: Controls the lifecycle of an AR experience.

- **XR Origin**: Transforms AR coordinates into Unity
  world coordinates.

Before adding the new game objects, delete the default **Main
Camera** . It will be replaced by a new **AR Camera** in the
**XR Origin**.

![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/delete-default-main-camera.png)

Add the new AR game objects to your scene: right-click the
**Hierarchy** pane and select **XR** . Add a
new **AR Session** and a new
**XR Origin**
game object.

<br />

### AR Foundation 6.x


- **AR Session**: Controls the lifecycle of an AR experience.

- **XR Origin**: Transforms AR coordinates into Unity
  world coordinates.

Before adding the new game objects, delete the default **Main
Camera** . It will be replaced by a new **AR Camera** in the
**XR Origin**.

![](https://developers.google.com/static/ar/develop/unity-arf/images/getting-started/delete-default-main-camera.png)

Add the new AR game objects to your scene: right-click the
**Hierarchy** pane and select **XR** . Add a
new **AR Session** and a new
**XR Origin**
game object.

<br />

## Configure Player Settings

### Android

1. Navigate to **File \> Build Settings** to open the **[Build Settings](https://docs.unity3d.com/Manual/BuildSettings.html)** window.
2. Under **Platform** , choose **Android** and click **Switch Platform**.
3. Click **Player Settings**.
4. 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](https://developers.google.com/ar/develop/unity-arf/enable-arcore) app, specify **Android 7.0 'Nougat' (API Level 24) or higher** . If you are building an [AR Optional](https://developers.google.com/ar/develop/unity-arf/enable-arcore) app, specify **Android API Level 19 or higher**. |
   | **Other Settings \> Scripting Backend** | Select **IL2CPP** instead of **Mono** to allow ARM64 support to be enabled in the next step. During development: - Use **Mono** + 32-bit (ARMv7) - Install a FAT (32-bit + 64-bit) ARCore APK When shipping to the Play Store: - Use **IL2CPP** - Enable both 32-bit (ARMv7) and 64-bit (ARM64) to meet Play Store 64-bit requirements - Optional (supported in 2018.3+): In **Build Settings** , enable **Android App Bundles** |
   | **Other Settings \> Target Architectures** | To meet the Google Play [64-bit requirement](https://developers.google.com/ar/64bit), 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](https://docs.unity3d.com/Manual/BuildSettings.html)** window.
2. Under **Platform** , choose **iOS** and click **Switch Platform**.
3. Click **Player Settings**.
4. Configure the following settings:

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

## What's next

- Get started with the optional [ARCore Extensions](https://developers.google.com/ar/develop/unity-arf/getting-started-extensions) package, which provides additional ARCore functionality for the AR Foundation framework.
- [Create an AR game using Unity's AR Foundation](https://codelabs.developers.google.com/arcore-unity-ar-foundation) (codelab).