<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/init(components:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC10componentsACSayAA9Component_pG_tcfc::OverloadGroup"
  },
  "title" : "init(components:)"
}
-->

# init(components:)

Creates an entity with multiple components.

```
@MainActor @preconcurrency convenience init(components: [any Component])
```

## Parameters

`components`

The components to add to the entity.

## Discussion

This initializer adds the contents of `components` to the new [`Entity`](/documentation/RealityKit/Entity).
The components you specify in this initializer override any default
components of the same type that RealityKit creates the entity with,
such as [`Transform`](/documentation/RealityKit/Transform).

For example, you can use this initializer to create an entity that
anchors to the floor, displays a 1x1x1m box,
and has a y-position of 0.5:

```swift
let floorCubeComponents = [
    AnchoringComponent(.plane(.horizontal, classification: .floor, minimumBounds: [1, 1])),
    ModelComponent(mesh: .generateBox(size: 1), materials: []),
    Transform(translation: [0, 0.5, 0])
]

let floorCubeEntity = Entity(components: floorCubeComponents)
```

> Note: You can change any of the entity’s components at any time by modifying
> the entity’s ``doc://com.apple.RealityKit/documentation/RealityKit/Entity/components`` set.

---

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)