One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

System

protocol · iOS 15.0+ · SDK 27.1

protocol System

An object that affects multiple entities in every update of a RealityKit scene. In RealityKit’s Entity Component System (ECS), a _system_ represents continuous behavior that affects multiple entities in the scene. Use systems to implement any behavior or logic that updates entities every scene update, such as different types of objects or characters. For example, a physics simulation system calculates and applies the affect of gravity, forces, and collisions for all entities. A system calls the ``update(context:)-69f86`` method as often as the `updatingSystemWhen` parameter of ``SceneUpdateContext/entities(matching:updatingSystemWhen:)`` defines. Systems often work with components. You might, for example, create a system that calculates the hunger levels for entities in a game capable of feeling hunger. To identify which entities experience hunger, use a component that stores hunger-related state data and add it to the selected entities. The hunger system then iterates through all entities that contain a hunger component and updates their state based on relevant factors, such as when the entity last ate or how much energy it expends. A complex game or experience may consist of many systems which need to be executed in a specific order. The ``dependencies-2s31o`` property defines when the `update` method for each system is called each frame. Update order is defined between system types and not between individual system instances. Systems and their dependencies form a directed acyclic graph (DAG). Custom systems are executed in dependency order. Systems without dependencies are updated in the order they were registered. If there are conflicting dependencies or cycles, then RealityKit ignores some conflicting dependencies and logs a warning. Each system instance is only run once per simulation step. Properties of a system are never serialized to a file or synced over the network. Therefore, store data on entities using components, rather than as part of the system. For more information, see <doc:implementing-systems-for-entities-in-a-scene>.

Members (1)

method · iOS 15.0+

update

Swift declaration
mutating func update(context: SceneUpdateContext)

A default implementation that does nothing. - Parameters: - context: The scene context for the scene to update.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

System.registerSystem()

Static protocol requirements cannot be called through an instance.

System.dependencies

Static protocol requirements cannot be called through an instance.

All RealityFoundation types →