Events
Respond to things happening in your RealityKit scene by subscribing to specific event types.
Overview
You can receive notifications to specific RealityKit events — all of which conform to the Event protocol — by subscribing to specific events. The kinds of events you can subscribe to include the following:
Two entities colliding
An entity receiving a new component
Audio playback reaching the end of its content
For example, you can receive a notification:
When two objects begin colliding by subscribing to CollisionEvents.Began event
When the scene redraws by subscribing to the SceneEvents.Update event