# Anchor.Extent missing?

**URL:** <https://community.nianticspatial.com/t/anchor-extent-missing/2233>\
**Category:** Bug Reports\
**Created:** [June 20, 2022, 3:46pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233 "2022-06-20T15:46:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natalie\_Settles](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Natalie\_Settles](https://community.nianticspatial.com/u/Natalie_Settles)\
**Post date:** [June 20, 2022, 3:46pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/1 "2022-06-20T15:46:44Z")

</div>

- **Issue category** : ARDK Documentation
- **Host machine & OS version** : Mac
- **ARDK version** : 2.0.0
- **Unity version** : 2020.3.34

I’ve been working through the example on [Plane Detection in the documentation](https://lightship.dev/docs/ardk/ar_world_tracking/plane_detection.html#index-0) and noticed that the method `Anchor.Extent` is now missing.

```
gameObject.transform.localScale = anchor.Extent;

```

Has this been deprecated, or replaced with something else? Thanks -

---

<div class="post-metadata">

**Author:** ![Erik\_Brown](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/erik_brown/32/25_2.png) [@Erik\_Brown](https://community.nianticspatial.com/u/Erik_Brown)\
**Post date:** [June 20, 2022, 5:22pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/2 "2022-06-20T17:22:52Z")

</div>

Hello Natalie,

anchor.Extent is used in the ARPlaneManager script on line 186 with a lowercase ‘a’. Hope this helps.

---

<div class="post-metadata">

**Author:** ![Natalie\_Settles](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Natalie\_Settles](https://community.nianticspatial.com/u/Natalie_Settles)\
**Post date:** [June 20, 2022, 7:24pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/3 "2022-06-20T19:24:37Z")

</div>

Thanks for your reply, Erik - interesting. Yes, I understand the variable in that case has a lowercase name. I was meaning to say that I couldn’t reference the Anchor class property `Extent` (though I now realize the class name is IARAnchor!) I tried importing all the using statements from the ARPlaneManager to see if I’d overlooked one, but the script still doesn’t recognize `Extent`. When I looked into it further, it turns out the reason `Extent` didn’t exist for me was that `anchor` was being interpreted as an IARAnchor which doesn’t have `Extent` instead of an IARPlaneAnchor which does. I’m not sure the [script in the docs](https://lightship.dev/docs/ardk/ar_world_tracking/plane_detection.html#index-0) actually works. It might need more explicit typing to fix this problem.

In any case - thanks for pointing out where to find a working `Extent` example - I’ll use that as a template to get things up and running. Thanks!

---

<div class="post-metadata">

**Author:** ![Natalie\_Settles](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Natalie\_Settles](https://community.nianticspatial.com/u/Natalie_Settles)\
**Post date:** [June 20, 2022, 8:08pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/4 "2022-06-20T20:08:09Z")

</div>

**Update** - Thanks again, Erik - based on what I learned from the ARPlaneManager, the the fix below makes the [script in the docs](https://lightship.dev/docs/ardk/ar_world_tracking/plane_detection.html#index-0) work:

```
private void OnAnchorsAdded(AnchorsArgs args)
{
    foreach (var anchor in args.Anchors)
    {
        // if the anchor type isn't a plane, don't instantiate anything
        if (anchor is IARPlaneAnchor planeAnchor)
        {
            // remember this anchor and its game object so we can update its position if we receive an update
            _planeLookup.Add(planeAnchor.Identifier, Instantiate(_prefab));
            var gameObject = _planeLookup[planeAnchor.Identifier];

            // display the plane object in the same position, orientation, and scale as the detected plane
            gameObject.transform.position = planeAnchor.Transform.ToPosition();
            gameObject.transform.rotation = planeAnchor.Transform.ToRotation();
            gameObject.transform.localScale = planeAnchor.Extent;
        }

    }
}

void OnAnchorsUpdated(AnchorsArgs args)
{
    foreach (var arAnchor in args.Anchors)
    {
        if (arAnchor is IARPlaneAnchor planeAnchor)
        {
            GameObject gameObject;
            if (_planeLookup.TryGetValue(planeAnchor.Identifier, out gameObject))
            {
                gameObject.transform.position = planeAnchor.Transform.ToPosition();
                gameObject.transform.rotation = planeAnchor.Transform.ToRotation();
                gameObject.transform.localScale = planeAnchor.Extent;
            }
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![Erik\_Brown](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/erik_brown/32/25_2.png) [@Erik\_Brown](https://community.nianticspatial.com/u/Erik_Brown)\
**Post date:** [June 20, 2022, 9:20pm UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/5 "2022-06-20T21:20:47Z")

</div>

Thank you for the detailed response and for submitting your code. I’ve created a request with Engineering to review the documentation and referenced your proposed solution.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/system/32/13_2.png) [@system](https://community.nianticspatial.com/u/system)\
**Post date:** [June 21, 2022, 2:47am UTC](https://community.nianticspatial.com/t/anchor-extent-missing/2233/6 "2022-06-21T02:47:29Z")

</div>

Closed on June 21, 2022, 2:47am UTC

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.
