ManipulationComponent.HitTarget
A component that redirects input to a different entity with a ManipulationComponent.
Declaration
struct HitTargetOverview
Add this component to an entity and set redirectedEntity to another entity that should activate when interaction occurs on the entity with the HitTarget component:
// Configure an entity for interaction.
entityToMove.components.set(ManipulationComponent())
// Create a component redirecting input to `entityToMove`.
let targetComponent = ManipulationComponent.HitTarget(redirectedEntity: entityToMove)
// Apply it to another entity. Now when input occurs on `proxyTarget`,
// the interaction on `entityToMove` will trigger.
proxyTarget.components.set(targetComponent)