Image-Based AR Trigger
using Unity AR Foundation
1. Introduction
This project demonstrates an AR application that detects a specific
image in the real world and overlays a virtual object (e.g., a 3D model
or video) onto it using Unity’s AR Foundation with ARCore. Unlike the
Vuforia-based implementation, this project uses the XR Plugin
Management system and Unity’s native ARTrackedImageManager
component for image tracking.
2. Project Workflow
Step 1: Install Required Packages
1. Open Window → Package Manager
2. Install the following packages:
○ AR Foundation
○ ARCore XR Plugin
○ XR Plugin Management
Step 2: Enable ARCore
1. Go to Edit → Project Settings → XR Plugin Management
2. Under the Android tab, enable ARCore
Step 3: Scene Setup
1. In the Hierarchy, add:
○ AR Session
○ XR Origin (Mobile AR)
○
2. Add AR Tracked Image Manager component to the XR Origin.
3. Configure the AR Camera inside XR Origin:
○ Facing Direction: World
○ Auto Focus: Enabled
Step 4: Create and Assign a Reference Image Library
1. In the Assets folder:
○ Right-click → Create → XR → Reference Image Library
2. In the Inspector:
○ Add your image as a reference
○ Specify its real-world width (e.g., 0.3 meters)
○ Enable "Keep Texture at Runtime"
3. Assign this image library to the AR Tracked Image Manager
component.
Step 5: Add a Prefab to Overlay Content
1. Create a prefab that contains the AR content you want to show
(e.g., a 3D object, text,etc).
2. Assign this prefab to the Tracked Image Prefab field in the AR
Tracked Image Manager.
3. When the image is detected, Unity will automatically instantiate
the prefab at the image’s position and orientation.
3. Building and Deploying
1. Go to File → Build Settings → Android → Switch Platform
2. In Player Settings:
○ Set Minimum API Level to 24 or higher
○ Enable ARCore Support
○ Set Camera Usage Description
3. Click Build and Run
4. Test the APK on an ARCore-compatible Android device