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

# AnchorEntity

An anchor that tethers entities to a scene.

```
@MainActor @preconcurrency class AnchorEntity
```

## Overview

Control how RealityKit places virtual objects into your scene with anchor entities.
`AnchorEntity` conforms to the [`HasAnchoring`](/documentation/RealityKit/HasAnchoring) protocol,
which gives it an [`AnchoringComponent`](/documentation/RealityKit/AnchoringComponent) instance.

RealityKit places anchors based on the anchoring component’s
[`target`](/documentation/RealityKit/AnchoringComponent/target-swift.property) property. For example, you can
configure an anchor entity to rest on a horizontal surface that RealityKit detects in an AR
scene like a table or floor, and RealityKit automatically places that anchor
after it detects an appropriate horizontal plane in the real world.
The example below creates an anchor to a horizontal surface:

```swift
AnchorEntity(.plane(.horizontal,
                    classification: .any,
                    minimumBounds: SIMD2<Float>(0.2, 0.2)
))
```

See [`Creating an anchor`](/documentation/RealityKit/AnchorEntity#Creating-an-anchor) for more
information about the different types of anchors available when using Reality Composer Pro.

![A diagram showing the components present in the anchor entity. It contains](images/com.apple.RealityKit/AnchorEntity-1@2x.png)

Add anchor entities directly to your scene’s [`anchors`](/documentation/RealityKit/Scene/anchors) collection,
or anywhere else in the scene hierarchy by adding them to the
[`children`](/documentation/RealityKit/HasHierarchy/children) collection of another entity in your scene. Because
`AnchorEntity` is a subclass of [`Entity`](/documentation/RealityKit/Entity), you can make an anchor entity
a subentity of any other entity. RealityKit might move anchor entities as the
scene updates, so the location and rotation of the anchor entity can change
relative to its container entity, even if your code never modifies its
[`transformMatrix(relativeTo:)`](/documentation/RealityKit/HasTransform/transformMatrix(relativeTo:)) property.

Some anchor entities might not show up in your scene at all if RealityKit
fails to detect an appropriate place for them. For example, an anchor entity
with an `image` target doesn’t show up in the scene until RealityKit detects
the specified image in the real world.

![A block diagram showing how anchor entities attach to a scene, and how they](images/com.apple.RealityKit/AnchorEntity-2@2x.png)

You can have multiple anchors in a RealityKit scene. For example, one anchor
can place a toy car on a horizontal surface, like a table, and another
can tie an informative text bubble to an image in the same scene.

> Note: By default, physics bodies and colliders affect only entities that share
> the same anchor.

An entity and its descendants can participate in the physics simulation at the
root of your scene by setting its
[`physicsSimulation`](/documentation/RealityKit/AnchoringComponent/physicsSimulation-swift.property) to

## Topics

### Creating an anchor

[`init()`](/documentation/RealityKit/AnchorEntity/init())

Creates a new anchor entity.

[`init(_:)`](/documentation/RealityKit/AnchorEntity/init(_:)-9vipc)

[`init(_:)`](/documentation/RealityKit/AnchorEntity/init(_:)-9rdwu)

Creates an anchor entity targeting a particular kind of anchor.

[`init(_:trackingMode:)`](/documentation/RealityKit/AnchorEntity/init(_:trackingMode:))

[`init(_:trackingMode:physicsSimulation:)`](/documentation/RealityKit/AnchorEntity/init(_:trackingMode:physicsSimulation:))

[`init(anchor:)`](/documentation/RealityKit/AnchorEntity/init(anchor:))

Creates an anchor entity that uses an existing AR anchor.

[`init(plane:classification:minimumBounds:)`](/documentation/RealityKit/AnchorEntity/init(plane:classification:minimumBounds:))

Creates an anchor entity that targets a plane with the given
characteristics.

[`init(raycastResult:)`](/documentation/RealityKit/AnchorEntity/init(raycastResult:))

Creates an anchor entity using the information about a real-world
surface discovered using a ray-cast query.

[`init(world:)`](/documentation/RealityKit/AnchorEntity/init(world:)-4snw2)

Creates an anchor entity with a target fixed at the given position in
the scene.

[`init(world:)`](/documentation/RealityKit/AnchorEntity/init(world:)-u9qv)

Creates an anchor entity with a target fixed at the given position in
the scene.

### Configuring the anchor

---

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)