API reference
API reference
Select your platform
No SDKs available
No versions available

GrabInteractor Class

Implements IRigidbodyRef
The GrabInteractor class facilitates interaction with objects that have a GrabInteractable component.
It supports interaction via both controllers and hands, though the HandGrabInteractor is recommended for hand interactions. This class provides advanced control over grab interactions, including forced selection and release, and dynamic component injection.

Properties

Rigidbody : Rigidbody
[Get]
The Unity Rigidbody most relevant to the current instance.
The role this Rigidbody plays varies according to the implementing type; for example, an HandGrab.HandGrabInteractor may use a Rigidbody for collision detection when grabbing.
Signature
Rigidbody Rigidbody
VelocityCalculator : IThrowVelocityCalculator
[Get][Set]
Signature
IThrowVelocityCalculator VelocityCalculator

Protected Methods

Awake ()
Signature
override void Awake()
Returns
override void
ComputeCandidate ()
Signature
override GrabInteractable ComputeCandidate()
Returns
override GrabInteractable
ComputePointerPose ()
Signature
override Pose ComputePointerPose()
Returns
override Pose
ComputeShouldUnselect ()
Signature
override bool ComputeShouldUnselect()
Returns
override bool
DoPreprocess ()
Signature
override void DoPreprocess()
Returns
override void
DoSelectUpdate ()
Signature
override void DoSelectUpdate()
Returns
override void
HandlePointerEventRaised ( evt )
Signature
override void HandlePointerEventRaised(PointerEvent evt)
Parameters
Returns
override void
InteractableSelected ( interactable )
Signature
override void InteractableSelected(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
override void
InteractableUnselected ( interactable )
Signature
override void InteractableUnselected(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
override void
Start ()
Signature
override void Start()
Returns
override void

Methods

ForceRelease ()
Forces the controller to unselect the currently selected GrabInteractable.
This method clears any overrides set by ForceSelect and reverts to the default selection behavior.
Signature
void ForceRelease()
Returns
void
ForceSelect ( interactable )
Forces the controller to select a specific GrabInteractable even if it is not the closest available option.
This method overrides the default selection process, allowing for programmatic control over which interactable is selected.
Signature
void ForceSelect(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
void
InjectAllGrabInteractor ( selector , rigidbody )
Injects both a ISelector and a Rigidbody into a dynamically instantiated GameObject.
Signature
void InjectAllGrabInteractor(ISelector selector, Rigidbody rigidbody)
Parameters
selector: ISelector  The selector component to be added.
rigidbody: Rigidbody  The Rigidbody component to be added.
Returns
void
InjectOptionalGrabCenter ( grabCenter )
Optionally adds a grab center to a dynamically instantiated GameObject, allowing for precise control over the center of grabbing operations by providing an external grab center transform.
Signature
void InjectOptionalGrabCenter(Transform grabCenter)
Parameters
grabCenter: Transform
Returns
void
InjectOptionalGrabTarget ( grabTarget )
Optionally adds a grab target to a dynamically instantiated GameObject, enabling targeted grabbing operations by providing an external grab target transform.
Signature
void InjectOptionalGrabTarget(Transform grabTarget)
Parameters
grabTarget: Transform
Returns
void
InjectOptionalVelocityCalculator ( velocityCalculator )
Adds a velocity calculator to a dynamically instantiated GameObject.
Signature
void InjectOptionalVelocityCalculator(IThrowVelocityCalculator velocityCalculator)
Parameters
velocityCalculator: IThrowVelocityCalculator
Returns
void
InjectRigidbody ( rigidbody )
Adds a Rigidbody to a dynamically instantiated GameObject, enhancing the physical interaction capabilities by providing an external Rigidbody component.
Signature
void InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectSelector ( selector )
Adds a ISelector to a dynamically instantiated GameObject.
Signature
void InjectSelector(ISelector selector)
Parameters
selector: ISelector  The external selector component to be added.
Returns
void
Unselect ()
This method unselects the currently selected interactable, and in addition reverts any selection overrides if necessary.
Signature
override void Unselect()
Returns
override void