docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Anchors samples

    The Anchors sample demonstrates AR Foundation Anchors functionality. You can open this sample in Unity from the Assets/Scenes/Anchors folder.

    Tip

    You can check which platforms support AR Foundation Anchors features by checking the Anchors platform support page.

    Anchors scene

    The anchors sample scene shows how to create anchors as the result of a ray cast hit. The Remove all anchors button removes all created anchors.

    The ARAnchorManager can create two kinds of anchors based on a ray cast hit:

    • If the ray hits a feature point, it creates a normal anchor at the hit pose using the TryAddAnchorAsync method.
    • If the ray hits a plane, it creates an anchor attached to the plane using the AttachAnchor method.

    Anchor visualizer

    The AR Foundation Samples GitHub repository contains a prefab to visualize anchors in your scene. You can use this prefab to get that you can use to get started with visualizing anchors:

    Prefab Description
    AR Anchor Debug Visualizer Visualize anchors with a Transform gizmo, and optionally visualize additional information such as the anchor's trackableId, sessionId, trackingState, and whether the anchor is attached to a plane.
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)