Variable: RayInteractable
constRayInteractable:Component<{ }>
Defined in: packages/core/src/input/state-tags.ts:32
Marks an entity as eligible for ray-based pointer interaction.
Remarks
- The InputSystem discovers all entities with
RayInteractableand registers their Object3D roots as raycast targets. - Used for UI elements, buttons, and clickable objects interacted via ray pointer.
- When a pointer enters/leaves or presses/releases on the entity, the system adds/removes the transient tags Hovered and Pressed.
Example
ts
export class HighlightSystem extends createSystem({ items: { required: [RayInteractable] } }) {
update() {
this.queries.items.entities.forEach(e => {
e.object3D.material.emissiveIntensity = e.hasComponent(Hovered) ? 1.0 : 0.0;
});
}
}