AR Foundation sample
AR Foundation sample
The AR Foundation Anchor sample shows a complete mobile app flow, live on device.
The flow
Scan
Use ARKit’s scene reconstruction to capture the room mesh live.
Place
Tap to position an anchor in your scan.
Save
Create the anchor payload and export it (as text or file).
Share
Send the payload to another device however you prefer.
Find
Import the payload, scan the same room on the other device, and run registration to lock the anchor.
What the sample handles
- ARKit/ARFoundation integration (scene mesh + placement UI).
- Payload serialization (binary format, compact and stable across versions).
- License state checking at runtime (
LicenseInfo.Resolve()). - Real-time diagnostics (feature counts, overlap %, RMSE (root-mean-square error, how far the fit is off), confidence).
Running it
- Install the main bridge package:
com.lansenou.unitybridge(see Install). - Import the AR Foundation Anchor sample (Package Manager > LansAnchor > Samples).
- Open the
ARFoundationAnchorscene. - Build to an iPhone with LiDAR (A14 or later, or any iPhone 15+).
- Tap to scan, place, save, and export your anchor.
Next
- Wiring this into your own AR Foundation app instead of the sample: Your own AR Foundation app.
- Building your own scene without ARKit at all: Manual anchoring.
- Reading the diagnostics the sample surfaces: Diagnostics.