Interactables
An
Interactable is the object that is acted upon (hovered or selected) by the
Interactors on your hands or controllers. An
Interactable can limit the maximum number of
Interactors that can hover or select it at a time.
You can have multiple Interactables for a given object. For example, to make a button that can interact with both rays and poke, you can add both a RayInteractable and PokeInteractable to the button’s GameObject(s). You can also use an InteractableGroup, which allows a group of Interactables to share properties like max hovering and Interactor selection.
Subclasses of
Interactable
will have relevant data (or can be configured with such data) that associated Interactors can then use to make decisions about hovering and selection. For example, a
RayInteractable may be configured with a
Surface that is then used for raycasting in a
RayInteractor.
Interactables often don’t handle the general interaction logic you find with
Pointer Events or when modifying transforms and passing off those responsibilities via events. For instance, surface-based interactions may be handled by
PointableElements, whereas grab-centric transform updates may be handled by
Grabbables.
- To learn about how interactables are selected and acted on, see Interactors.
- To learn how an interactor is chosen to select the interactable when there are multiple interactors available, see InteractorGroup.
- To learn about the event data that’s broadcasted when an interactor selects an interactable, see Pointer Events.