AR Foundation
AR Foundation enables you to create multi-platform augmented reality (AR) apps with Unity. In an AR Foundation project, you choose which AR features to enable by adding the corresponding manager components to your scene. When you build and run your app on an AR device, AR Foundation enables these features using the platform's native AR SDK, so you can create once and deploy to the world's leading AR platforms.
The Simple AR sample scene shows you how to get started with plane detection and raycasting
Required packages
The AR Foundation package contains interfaces for AR features, but doesn't implement any features itself. To use AR Foundation on a target platform, you also need a separate provider plug-in package for that platform.
Unity officially supports the following provider plug-ins:
- Google ARCore XR Plug-in on Android
- Apple ARKit XR Plug-in on iOS
- OpenXR Plug-in on HoloLens 2
Note
AR Foundation will not work on a target platform unless you also install the provider plug-in package for that platform. See Install AR Foundation for detailed setup instructions.
Features
AR Foundation supports the following features:
Feature | Description |
---|---|
Session | Enable, disable, and configure AR on the target platform. |
Device tracking | Track the device's position and rotation in physical space. |
Camera | Render images from device cameras and perform light estimation. |
Plane detection | Detect and track surfaces. |
Image tracking | Detect and track 2D images. |
Object tracking | Detect and track 3D objects. |
Face tracking | Detect and track human faces. |
Body tracking | Detect and track a human body. |
Point clouds | Detect and track feature points. |
Raycasts | Cast rays against tracked items. |
Anchors | Track arbitrary points in space. |
Meshing | Generate meshes of the environment. |
Environment probes | Generate cubemaps of the environment. |
Occlusion | Occlude AR content with physical objects and perform human segmentation. |
Participants | Track other devices in a shared AR session. |
Platform support
AR Foundation provider plug-ins rely on platform implementations of AR features, such as Google's ARCore on Android and Apple's ARKit on iOS. Not all features are available on all platforms.
The table below lists the available features in each Unity-supported provider plug-in:
Feature | ARCore | ARKit | OpenXR |
---|---|---|---|
Session | Yes | Yes | Yes |
Device tracking | Yes | Yes | Yes |
Camera | Yes | Yes | |
Plane detection | Yes | Yes | |
Image tracking | Yes | Yes | |
Object tracking | Yes | ||
Face tracking | Yes | Yes | |
Body tracking | Yes | ||
Point clouds | Yes | Yes | |
Raycasts | Yes | Yes | |
Anchors | Yes | Yes | Yes |
Meshing | Yes | Yes | |
Environment probes | Yes | Yes | |
Occlusion | Yes | Yes | |
Participants | Yes |
Samples
For pre-configured sample scenes that demonstrate how to use each feature, see the AR Foundation Samples GitHub repository.
* Apple and ARKit are trademarks of Apple Inc., registered in the U.S. and other countries and regions.