---
# System prepended metadata

title: AR Foundation

---

---
robots: noindex, nofollow
---

# AR Foundation


AR Foundation enables the construction of Augmented Reality applications targeting both iOS and Android devices. This means you can use AR Foundation to build an AR Unity application and deploy it to either an iOS or Android device without changing any of the Scene’s scripts or components.

## AR Foundation Architecture and AR SDKs

To work with AR Foundation, you first have to understand its structure. The top layer of its modulare design doesn’t hide everything else. Sometimes, the platform-dependent layers and their respective capabilities shine through, and you must consider these as well.

AR Foundation is a highly modular system. At the bottom, individual provider plug-ins contain the glue to the platform-specific native AR functionality (ARCore and ARKit). On top of that, the XR Subsystems provide different functionalities; with a platform-agnostic interface.

Note that feature support varies by platform: while Microsoft’s HoloLens or Magic Leap are theoretically supported, they only provide limited functionality. For these platforms, AR Foundation is currently not a great option. For HoloLens, use the [Mixed Reality Toolkit](https://github.com/microsoft/MixedRealityToolkit-Unity) instead.

![](https://hackmd.io/_uploads/ryoa-QXzs.png)

On top, AR Foundation provides some ready-made components and scripts that you include in your project, which interact with the subsystems.

We’re not looking at [Unity MARS](https://unity.com/products/unity-mars) in this guide – it provides some additional authoring tools for Augmented Reality. However, it’s not included in the Unity normal license.

## AR Foundation Architecture in Code

The following image shows a concrete example: you integrate the [ARRaycastManager](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARRaycastManager.html) GameObject in your project. This component manages the platform-agnostic interface [XRRaycastSubsystem](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRRaycastSubsystem.html): an abstract class that is implemented by a provider. The concrete implementation is dependent on the platform – the ARCore variant is the [ARCoreRaycastSubsystem](https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/api/UnityEngine.XR.ARCore.ARCoreRaycastSubsystem.html).

![](https://hackmd.io/_uploads/HkL2GmmMo.png)

What other components are there, based on Google ARCore as an example? The [Google ARCore XR Plugin](https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/manual/index.html) is the provider plugin that provides the platform specific implementation. You’ll need to install it to your project alongside with the AR Foundation plugin to target ARCore.

In addition, Google provides the [ARCore Extensions](https://developers.google.com/ar/reference/unity-arf). It’s a free Unity package that you need to self-import to your project; it’s not yet available through the Unity Package Manager. The package adds some Google specific features that are not in AR Foundation, e.g., [Google cloud anchors](https://developers.google.com/ar/develop/java/cloud-anchors/overview-android) or support for recording and playback of AR sessions. It’s completely optional to add, though.