AR Anchor Manager | AR Foundation | 3.0.1
docs.unity3d.com
    Show / Hide Table of Contents

    AR Anchor Manager

    The anchor manager is a type of trackable manager.

    alt text

    The anchor manager will create GameObjects for each anchor. A anchor is a particular point in space that you are asking the device to track. Some SDKs refer to these as "anchors". The device typically performs additional work to update the position and orientation of the anchor throughout its lifetime. Anchors are generally resource intensive objects that should be used sparingly.

    Adding and Removing Anchors

    Anchors are typically added and removed via script, by calling AddAnchor and RemoveAnchor on the ARAnchorManager. In some cases anchors may be created through other means, such as loading an AR World Map on ARKit which includes saved anchors.

    When you add a anchor, it may take a frame or two before it is reported as added by the anchor manager's anchorsChanged event. Between the time you add it and it is reported as added, the anchor will be in a "pending" state. You can query for this with the ARAnchor.pending property.

    Likewise, when you remove a anchor, it may be a frame before it is reported as having been removed. If you remove a anchor before it is reported as added, you will not receive any events for it.

    You should always remove anchors through the anchor manager. Do not Destroy an ARAnchor unless its manager has also been destroyed.

    Attaching Anchors

    You can also create anchors that are "attached" to a plane. The following ARAnchorManager method does this

    public ARAnchor AttachAnchor(ARPlane plane, Pose pose)
    

    "Attaching" to a plane affects the semantics for a anchor update. Anchors will only change their position along the normal of the plane they are attached to, effectively maintaining a constant distance from the plane.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023