To create a simple AR Foundation app, do the following:
- Having installed the Android/iOS modules and AR template, create a new Unity project using the AR template.
- For the XR Plugin Management setting, select the tab for your target platform (iOS / Android) and check the plugin for your platform (ARKit for iOS and ARCore for Android).
- Create a new, empty scene.
- Add a Directional Light to the scene.
- Add an AR Session GameObject and an AR Session Origin GameObject (menu: GameObject | XR).
- In the Hierarchy window, select the AR Camera child object of the AR Session Origin GameObject. In the Inspector window, tag this GameObject as Main Camera:

Figure 15.75 – Tagging the AR Camera child GameObject as Main Camera
- Add the AR content to your scene. In this simple recipe, we'll add two floating cubes in front of the camera to the lower right of...