# Bad documentation for Anchor placement

**URL:** <https://community.nianticspatial.com/t/bad-documentation-for-anchor-placement/3323>\
**Category:** Bug Reports\
**Created:** [February 27, 2023, 4:23pm UTC](https://community.nianticspatial.com/t/bad-documentation-for-anchor-placement/3323 "2023-02-27T16:23:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonDarksideJ](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/simondarksidej/32/1492_2.png) [@SimonDarksideJ](https://community.nianticspatial.com/u/SimonDarksideJ)\
**Post date:** [February 27, 2023, 4:23pm UTC](https://community.nianticspatial.com/t/bad-documentation-for-anchor-placement/3323/1 "2023-02-27T16:23:35Z")

</div>

_Include the following details while filing a bug report (edit as applicable):_

- **Issue category** : ARDK Documentation
- **Device type & OS version** : Any
- **Host machine & OS version** : Any
- **Issue Environment** : On Device
- **Xcode version** :
- **ARDK version** : 2.4.2
- **Unity version** : 2021.3

Bug reproduction steps:  
In the anchor documentation - [Tracking AR Anchors — Niantic Lightship Augmented Reality Developer Kit release-2.4.2 documentation](https://lightship.dev/docs/ardk/ar_world_tracking/tracking_ar_anchors.html)

The example given is

```csharp
void SubscribeToSession(IARSession arSession)
{
  arSession.AnchorsUpdated += OnAnchorsUpdated;
}

void OnAnchorsUpdated(AnchorsArgs args)
{
  foreach (var anchor in args.Anchors)
  {
    // Find GameObject from Dictionary containing
    // existing Anchor to GameObject mappings
    var go = virtualObjects[anchor.Identifier];

    go.transform.position = anchor.Transform.ToPosition();
    go.transform.rotation = anchor.Transform.ToRotation();
  }
}

```

However, this is very bad as it will quickly fill up with exceptions, especially IF either Plane or Depth Finding is added, as they also create anchors, instead, the example should be as follows:

```csharp
void SubscribeToSession(IARSession arSession)
{
  arSession.AnchorsUpdated += OnAnchorsUpdated;
}

void OnAnchorsUpdated(AnchorsArgs args)
{
    foreach (var anchor in args.Anchors)
    {
        if (instantiatedPrefabs.TryGetValue(anchor.Identifier, out var go))
        {
            go.transform.SetPositionAndRotation(anchor.Transform.ToPosition(), anchor.Transform.ToRotation());
        }
    }
}

```

To be safer and cleaner to execute (as well as using the Unity recommended “SetPositionAndRotation” function.

---

<div class="post-metadata">

**Author:** ![Bill\_McLaughlin](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/bill_mclaughlin/32/35_2.png) [@Bill\_McLaughlin](https://community.nianticspatial.com/u/Bill_McLaughlin)\
**Post date:** [February 28, 2023, 5:24pm UTC](https://community.nianticspatial.com/t/bad-documentation-for-anchor-placement/3323/2 "2023-02-28T17:24:05Z")

</div>

Hi Mr Jackson, I’ve put in a request to review the sample code for this feature and make it cleaner where possible. Thank you for looking out. Your input is making Lighthsip more usable for everyone

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:46pm UTC](https://community.nianticspatial.com/t/bad-documentation-for-anchor-placement/3323/3 "2026-03-05T23:46:51Z")

</div>

Closed on March 5, 2026, 11:46pm UTC

Age
