Set up samples
Understand how to clone and open the AR Foundation Samples project in Unity, and build the project to your target device.
To use the AR Foundation sample app, clone the samples from GitHub, configure project settings, then build and run on a target device.
Requirements
For this version of AR Foundation (X.Y), use the main
branch of the AR Foundation Samples repository.
Clone and open samples
To clone and open the AR Foundation Samples project:
- Navigate to the AR Foundation Samples repository in GitHub and Clone the repository (GitHub documentation).
- Open the Unity Hub and select Add > Add project from disk to open the file explorer.
- Navigate to the root of the cloned repository and select Add Project.
- Click on the project to open it in the Unity Editor.
- You can now edit the scenes to meet your needs from the
Assets/Scenes
folder, or continue to Build and run on device.
Important
If the Unity Hub shows the warning symbol next to the project, you don't have the correct Unity Editor version installed. This can cause errors in the AR Foundation Samples project. To fix the Missing Editor Version warning, click on the warning symbol, select the Missing Version of the Editor and Install Version.
Build and run on device
To build and run the sample on your device for the first time:
- Connect your device to your computer.
- Open the Build Profiles window (File > Build Profiles).
- Select your target platform from the Platforms menu.
- Optionally, click Open Scene List to select specific scenes you want to build. By default, Unity builds all scenes in the project.
- Under Platform Settings, select your device from the Run Device dropdown.
- Press Build and Run.
- In the dialog window, choose a location and file name for your build, and select Save.
If the build is successful, Unity will install the application on your target device.
In future builds, you can build and run to device directly from File > Build and Run if you haven't changed your target device.
Note
Check the documentation for your target platform to understand whether there are any specific project settings that you must configure for your chosen platform.
Build on Meta Quest devices
This repository is configured with the Google ARCore XR Plug-in enabled by default on the Android platform. To build for Meta Quest, disable the Google ARCore provider in the Android tab of Project Settings > XR Plug-in Management, then follow the Meta Quest Project setup instructions.