An element of a RealityKit scene to which you attach components that provide appearance and behavior characteristics for the entity.
- iOS 13.0+Beta
- macOS 10.15+Beta
- Mac Catalyst 13.0+Beta
- Xcode 11.0+Beta
RealityKit defines a few concrete subclasses of
Entity that provide commonly used functionality. For example, you typically start by creating an instance of
Anchor to anchor your content, and add the anchor to a scene’s
anchors collection. You might then instantiate a
Model to represent a physical object in the scene, and add that as a child entity to the anchor. You can also create custom entities, and add them either to an anchor, or as children of another entity.
You can load predefined entities or a hierarchy of entities from your app’s bundle, or from a file on disk, using the methods in Stored Entities. Alternatively, you can create entities programmatically.
Entities contain components (instances conforming to the
Component protocol) that provide appearance and behaviors for the entity. For example, the
Transform component contains the scale, rotation, and translation information needed to position an entity in space. You store components in the entity’s
components collection, which can hold exactly one of any component type. It makes sense to have only a single
Transform component, one
Model (specifying the visual appearance of the entity), and so on.
All entities inherit a few common components from the
Entity base class: the
Transform component for spatial positioning, and
Synchronization, which enables synchronization of the entity among networked peers. Specific types of entities define additional behaviors. For example, the model entity has components for visual appearance (
Model), collision detection (
Collision), and physics simulations (