---
title: "init(components:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/entity/init(components:)-1lmhe"
---

# init(components:)

Creates an entity with multiple components.

## Declaration

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

## Parameters

- `components`: The components to add to the entity.

## Discussion

Discussion This initializer adds the contents of components to the new 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. 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: 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 components set.

## See Also

### Creating an entity

- [init()](realitykit/entity/init().md)
- [clone(recursive:)](realitykit/entity/clone(recursive:).md)
- [didClone(from:)](realitykit/entity/didclone(from:).md)
