RealityKit equivalent to GKComponentSystem?

Does RealityKit have a component system? Something equivalent to GameplayKit’s GKComponentSystem (https://developer.apple.com/documentation/gameplaykit/gkcomponentsystem)?

I would like to be able to manage periodic updates for certain custom RealityKit components without having to manually traverse the entity hierarchy trying to find all entities with that component.

Accepted Reply

Hello,

RealityKit does not have an equivalent to GKComponentSystem, I recommend that you file an enhancement request for this feature using Feedback Assistant.

That being said, you could implement your own "component system" to avoid traversing the entity hierarchy, essentially you would store an array of entities for each different component type. Every time you add a component to an entity, you would also append a reference to that entity to the corresponding array.

Replies

Hello,

RealityKit does not have an equivalent to GKComponentSystem, I recommend that you file an enhancement request for this feature using Feedback Assistant.

That being said, you could implement your own "component system" to avoid traversing the entity hierarchy, essentially you would store an array of entities for each different component type. Every time you add a component to an entity, you would also append a reference to that entity to the corresponding array.
Thanks for the response! I’ll file an enhancement request.