Setting Up AR Foundation in Unity Learn: The Ultimate Step-by-Step Guide

Robert Jul 13, 2026

Are you eager to delve into the world of Augmented Reality (AR) using Unity and Microsoft's AR Foundation? Setting up AR Foundation in Unity Learn can transform your gaming or application development journey, enabling you to create immersive AR experiences. This comprehensive guide will walk you through the process, ensuring you understand every step and are equipped to leverage AR Foundation's powerful features.

Getting started with AR in Unity
Getting started with AR in Unity

Before we begin, ensure you have Unity (2018.4 or later) installed on your computer, along with the AR Foundation package. If you haven't already, join Unity Learn's AR Foundation course to follow along with step-by-step guidance and resources.

Unity Tutorial: Creating an inventory(PART 1) - The basic functionality
Unity Tutorial: Creating an inventory(PART 1) - The basic functionality

Installing and Setting Up AR Foundation

AR Foundation is not installed by default in Unity, so let's start by adding it to your project.

Augmented Reality With Unity Ar Foundation: A Practical Guide To Cross-Platform Ar Development With Unity 2020 And Later Versions
Augmented Reality With Unity Ar Foundation: A Practical Guide To Cross-Platform Ar Development With Unity 2020 And Later Versions

1. Open your Unity project and go to Window > Package Manager to open the Package Manager window. Click on the 'Add package from git URL...' button.

Adding the AR Foundation Package

the before and after photoshopped image shows an area with trees, houses, and buildings
the before and after photoshopped image shows an area with trees, houses, and buildings

In the 'Add package from git URL...' field, paste the following URL and click 'Add':

https://github.com/Unity-Technologies/arfoundation.git#upm

Enabling AR Foundation

Learn Unity - Beginner's Game Development Tutorial
Learn Unity - Beginner's Game Development Tutorial

Once added, enable AR Foundation in your project. From the Project window, find 'XR Plug-in Management' and expand it. Check the box next to 'AR Foundation' to enable it.

Creating Your First AR Scene

Now that AR Foundation is set up, let's create a simple AR scene to get you started.

How To Make An RPG For FREE - Unity Tutorial #001 - LEARNING THE BASICS
How To Make An RPG For FREE - Unity Tutorial #001 - LEARNING THE BASICS

1. Go to File > New Scene to create a new scene. Rename it to something like 'AR Hello World' for ease of reference.

Adding the AR Session

How To Build An Event System in Unity
How To Build An Event System in Unity
How to Download and Install Unity in 2025: Beginner’s Complete Guide
How to Download and Install Unity in 2025: Beginner’s Complete Guide
Button Animation (Using Animator) - Unity 3D[Tutorial][C#]
Button Animation (Using Animator) - Unity 3D[Tutorial][C#]
Unity Good Graphics Tutorial
Unity Good Graphics Tutorial
FULL 3D ENEMY AI in 6 MINUTES! || Unity Tutorial
FULL 3D ENEMY AI in 6 MINUTES! || Unity Tutorial
Pottery tutorial in Unity, Part 1
Pottery tutorial in Unity, Part 1
Unity 5 - From Beginner to Pro #25 - Materials
Unity 5 - From Beginner to Pro #25 - Materials
In Development - Unity Splash Screen tools
In Development - Unity Splash Screen tools
Unity Tutorial For Beginners - How To Make A Game - Part 024 - Bloom & Sunshafts
Unity Tutorial For Beginners - How To Make A Game - Part 024 - Bloom & Sunshafts
Unity 5 - From Beginner to Pro #29 - Standard Shader (other maps)
Unity 5 - From Beginner to Pro #29 - Standard Shader (other maps)
the menu for options menu in unity
the menu for options menu in unity
Field of view visualisation (E02)
Field of view visualisation (E02)
Flexible LOOT SYSTEM in Unity with Random Drop Rates
Flexible LOOT SYSTEM in Unity with Random Drop Rates
Drawing in Unity - Under60sec tutorial
Drawing in Unity - Under60sec tutorial
Making a Multiplayer FPS in Unity (EP. 1) - uNet Tutorial
Making a Multiplayer FPS in Unity (EP. 1) - uNet Tutorial
CREATING 2D LIGHTS - UNITY TUTORIAL
CREATING 2D LIGHTS - UNITY TUTORIAL
The Unity Tutorial For Complete Beginners
The Unity Tutorial For Complete Beginners
How To Plan Your Unity Game
How To Plan Your Unity Game
Android Game Development 3D
Android Game Development 3D
Simple Question Dialog in Unity! (Yes-No Ok-Cancel Unity Tutorial)
Simple Question Dialog in Unity! (Yes-No Ok-Cancel Unity Tutorial)

From the Unity hierarchy, delete the 'Main Camera' and 'Directional Light' objects since they won't be necessary for AR. Right-click in the hierarchy, navigate to 'UI > Panel' to add a 'Canvas' with a 'Raw Image' child object. This will serve as our AR view.

Next, drag 'AR Session' from the Project window (under 'AR Foundation > Prefabs') into the scene hierarchy. This prefab handles AR session management and provides essential functionality like device detection and session tracking.

Configuring the AR Camera and Main Camera

Select the 'Main Camera' in the hierarchy and delete it. Right-click in the hierarchy, navigate to 'AR Foundation > Cameras' and add 'AR Camera'. AR Camera is a customizable camera component designed for AR applications, providing better performance and functionality than the default Unity camera.

Now, create a new empty GameObject in the hierarchy and name it 'Camera Parent'. Add 'AR Camera' and 'AR Session' as children of 'Camera Parent'. This helps keep your hierarchy clean and organized.

Subject Tracking and Object Placement

AR Foundation provides several tracking methods, including plane detection, image tracking, and more. Let's focus on plane detection for simplicity, using it to place virtual objects in the real world.

Setting Up Plane Detection

AR Session includes a 'Plane Manager' component, which handles plane detection and mesh generation. Ensure it's enabled, as it is by default. For a better visual representation, add 'Plane Outline' prefab (AR Foundation > Prefabs) as a child of 'AR Session'.

Create an empty GameObject named 'Virtual Object Parent' in the hierarchy. This will serve as the parent for your virtual objects. For instance, add a 'Cube' prefab (Assets > Standard Assets > Utility > Cube) as a child of 'Virtual Object Parent'.

Spawning Virtual Objects

To spawn virtual objects, use AR Foundation's 'ARPlaceAtFollow' script. Add it to the 'Cube' object, and you'll see that it follows the AR session's plane detection and spawns the cube on the detected plane(s).

Testing Your AR Scene

To test your AR scene, ensure your device supports AR Foundation. If so, click the 'Play' button in Unity, build, and run your scene on your AR-capable device. You should see the detected planes and your 'Virtual Object Parent' spawning on them.

Congratulations! You've successfully set up AR Foundation in Unity and created your first AR scene. Explore Unity Learn's AR Foundation course for more advanced topics and continues learning. Happy AR developing!