TL;DR:

  • AR Foundation 6.x is the fastest path to a shipping ARKit app — one codebase covers both iOS and Android
  • You can go from zero to tap-to-place in about two hours with Unity 6 and ARKit 7
  • If visionOS is in your roadmap, budget for a partial rewrite in RealityKit — AR Foundation doesn’t target visionOS

AR Foundation is Unity’s cross-platform AR abstraction layer. On iOS it delegates to ARKit; on Android it delegates to ARCore. You write C# once, and the platform-specific provider handles the rest at runtime.

As of mid-2026, AR Foundation 6.x ships with ARKit 7 support (iOS 17+). This guide targets those versions and gets you to a working tap-to-place app on a real device.

Prerequisites

Before opening Unity, make sure you have:

  • Unity 6 (6000.0.x LTS or later) — AR Foundation 6.x isn’t backported to Unity 2022
  • Xcode 16 or later — ARKit 7 entitlements require Xcode 16’s build system
  • Apple Developer account (£79/year) — required for on-device debugging and TestFlight
  • iPhone 12 or newer for people occlusion and LiDAR depth; iPhone 11 supports plane detection but not LiDAR features
  • iOS 14.0+ deployment target (iOS 17+ for ARKit 7 room tracking features)

Windows users can develop in the Unity Editor simulator but can’t build for iOS — that requires macOS with Xcode installed.

Project Setup

Create a new Unity project using the 3D (URP) template. URP is recommended because the AR Foundation samples all target it.

In Window → Package Manager, switch to Unity Registry and install:

  1. AR Foundation (6.x)
  2. Apple ARKit XR Plugin (6.x)

Pin both packages to the same 6.x minor version to avoid mismatches.

Next, go to Edit → Project Settings → XR Plug-in Management. Under the iOS tab, check Apple ARKit and restart the editor when prompted.

Finally, in Player Settings → iOS → Other Settings:

  • Set Target minimum iOS Version to 14.0
  • Set your Bundle Identifier to match your Apple Developer account
  • Add a Camera Usage Description string — App Store Review rejects builds without this

Core Scene Architecture

Delete the default Main Camera from a new scene, then add:

  • GameObject → XR → AR Session — manages the AR session lifecycle; you rarely interact with it directly in code
  • GameObject → XR → XR Origin (Mobile AR) — places the AR camera, Camera Offset, and XR Origin root in your hierarchy

The AR Camera Background component on the Main Camera renders the device camera feed automatically — no manual setup needed.

Plane Detection

Plane detection identifies flat surfaces (floors, tables, walls) that you can place objects on.

Select the XR Origin GameObject and add an AR Plane Manager component. Set Detection Mode to Everything and assign a plane visualiser prefab to Plane Prefab. Import the AR Foundation samples from Package Manager to get the default AR Default Plane prefab.

Build to device, scan a flat surface, and plane outlines will appear within a few seconds.

Tap-to-Place with Raycasting

The core ARKit interaction pattern: user taps the screen → you raycast into AR space → find the nearest plane → spawn an object there.

Create a C# script named TapToPlace and attach it to a new empty GameObject called AR Manager:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;

[RequireComponent(typeof(ARRaycastManager))]
public class TapToPlace : MonoBehaviour
{
    [SerializeField] private GameObject spawnPrefab;
    [SerializeField] private bool singleInstance = true;

    private ARRaycastManager _raycastManager;
    private GameObject _spawnedObject;
    private static readonly List<ARRaycastHit> Hits = new();

    private void Awake() => _raycastManager = GetComponent<ARRaycastManager>();

    private void Update()
    {
        if (!Input.GetMouseButtonDown(0) &&
            (Input.touchCount == 0 || Input.GetTouch(0).phase != TouchPhase.Began))
            return;

        Vector2 pos = Input.touchCount > 0
            ? Input.GetTouch(0).position : (Vector2)Input.mousePosition;

        if (_raycastManager.Raycast(pos, Hits, TrackableType.PlaneWithinPolygon))
        {
            var hitPose = Hits[0].pose;
            if (singleInstance)
            {
                if (_spawnedObject == null)
                    _spawnedObject = Instantiate(spawnPrefab, hitPose.position, hitPose.rotation);
                else
                    _spawnedObject.transform.SetPositionAndRotation(hitPose.position, hitPose.rotation);
            }
            else Instantiate(spawnPrefab, hitPose.position, hitPose.rotation);
        }
    }
}

Add an AR Raycast Manager component to the same GameObject, assign a 3D prefab to Spawn Prefab, and build to device.

People Occlusion and Performance

People occlusion makes AR objects appear correctly behind real people. Requires iPhone 12 or newer. Add the AR Occlusion Manager component to your Main Camera and set Human Segmentation Stencil Mode to Fastest.

A few performance tips worth keeping in mind:

Target 60fps and monitor thermal budget with Xcode Instruments. Use GPU Instancing on shared materials to reduce draw calls — stay under 100 for reliable 60fps on iPhone 13/14. Set up LODGroup components on placed objects; AR objects are usually small on screen. Pool spawned objects with ObjectPool<T> if your app spawns many at once — GC spikes from frequent Instantiate/Destroy cause visible hitches.

Common Errors

  • “ARKit not supported” — you’re running on a simulator or a device older than iPhone 6s; test on a physical device
  • Black camera view — missing camera usage description in Player Settings
  • Planes not detected — point at a well-lit, textured surface; plain white walls don’t give ARKit enough visual features to work with
  • Objects spawn underground — your prefab pivot isn’t at the bottom of the mesh; offset the spawn position up by Vector3.up * 0.001f

The Bottom Line

AR Foundation with Unity 6 and ARKit 7 is the fastest path to a cross-platform AR app. Follow the setup steps above, build to device, and you’ll have tap-to-place working in an afternoon. If visionOS is in your future roadmap, plan for a RealityKit rewrite rather than a recompile — AR Foundation doesn’t target Apple’s spatial computing platform, and that gap won’t close any time soon.