A representation of a geometry or a behavior that you apply to an entity.
- iOS 13.0+Beta
- macOS 10.15+Beta
- Mac Catalyst 13.0+Beta
- Xcode 11.0+Beta
You assemble a particular combination of behavior and appearance for an entity by adding components to the
components set of an
Entity instance. Each component, represented by a type that conforms to the
Component protocol, defines a single aspect of the entity. For example, one might define a position in space, while another provides a visual appearance. You can add at most one component of a given type to an entity.
RealityKit has a variety of predefined component types that you can use to add commonly needed characteristics. For example, the
Model specifies visual appearance with a mesh and materials. The
Collision contains a shape and other information used to decide if one entity collides with another.
You can also define custom component types. When you do, register that type with the system by calling the new component’s
register method—a default implementation of which is provided by the
Component protocol. Call this method once before using the component type. You don’t need to make this call for component types that RealityKit provides.