<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnchorStateEvents",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17AnchorStateEventsO"
  },
  "title" : "AnchorStateEvents"
}
-->

# AnchorStateEvents

Events that trigger on an entity to indicate a change in anchor state.

```
enum AnchorStateEvents
```

## Overview

You need to set up [`SpatialTrackingSession`](/documentation/RealityKit/SpatialTrackingSession) to listen for this event.

## Topics

### Structures

[`struct DidAnchor`](/documentation/RealityKit/AnchorStateEvents/DidAnchor)

Event that triggers on an entity after the entity is anchored with certain reasons.

[`struct DidFailToAnchor`](/documentation/RealityKit/AnchorStateEvents/DidFailToAnchor)

Event that triggers on an entity when pending anchor encounters an error.

[`struct WillUnanchor`](/documentation/RealityKit/AnchorStateEvents/WillUnanchor)

Event that triggers on an entity before the entity is unanchored with certain reasons.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)