Build AR experiences tied to specific real-world locations using Custom Locations — scan a space with Spectacles, import the mesh into Lens Studio, and place AR content that appears in that exact physical location. Load when implementing location-locked AR, site-specific experiences, or scanning-based content placement.
Requirements: Lens Studio v5.7+, Spectacles OS v5.060+. Custom Locations Lens app on Spectacles.
Reference: Custom Locations/ template (London example)
1. Scan location on-device (Custom Locations Lens)
↓ creates colored mesh + localization viewpoints
2. Publish scan → get Location ID
↓
3. Import mesh into Lens Studio (Scene → World → Custom Location)
↓ enter Location ID
4. Place AR content relative to the scanned mesh
↓
5. Publish Lens → users see content at that location
Good scan tips:
World → Custom LocationThe mesh is a dev tool for positioning content — don't use it as a visual in the published Lens.
Position virtual objects relative to the imported mesh in Lens Studio. The LocatedAtComponent ties objects to the location:
// Objects under the Custom Location node in hierarchy
// are automatically placed using LocatedAtComponent tracking
// No scripting needed for basic placement
// For dynamic content at runtime:
@component
export class LocationContentController extends BaseScriptComponent {
@input
@hint("The Custom Location scene object (with LocatedAtComponent)")
customLocation: SceneObject
onAwake(): void {
this.createEvent('OnStartEvent').bind(() => this.setupContent())
}
private setupContent(): void {
// Check if location has been found (device localized to scan)
const locatedAt = this.customLocation
.getComponent('Component.LocatedAtComponent')
if (locatedAt) {
print("[CustomLoc] Location component found")
}
}
}
Link up to 5 nearby locations (<20m apart) into a group for seamless transitions:
Custom Location Group component → enter Group ID → Reload GroupSceneObject
└── Custom Location Group (component, Group ID: "abc123")
├── Custom Location A
├── Custom Location B
└── Custom Location C
When users can't localize from certain angles, add viewpoints without changing the mesh:
... on existing scan → + → confirmNew scan = new ID, same coordinate frame → no need to reposition AR content
| Concept | Description |
|---|---|
| Location ID | Unique scan identifier — share carefully (public once published) |
| Viewpoints | Camera positions from which Spectacles can localize |
| Localization | Device recognizing its position within a scanned space |
| Mesh | Visual aid in Lens Studio only — not rendered in published Lens |
| LocatedAtComponent | Lens Studio component that anchors content to a location |