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

Grabbable Class

The Grabbable class enables interaction with and manipulation of the object it's attached to when an Interactor<TInteractor,TInteractable> selects that object.
This class implements the IGrabbable and ITimeConsumer interfaces and inherits from PointableElement to handle pointer events effectively.
Utilize this class to make any GameObject interactive and responsive to grab-based user interactions. It supports both single-hand and dual-hand interactions, allowing for complex object manipulation.

Properties

Gets or sets the maximum number of grab points.
This property is crucial for defining how many points can be used to interact with the object.

Fields

Provides access to the transform that should be manipulated.
This can be the transform of the GameObject this component is attached to or a different specified transform.
Lists the current grab points as poses.
These are used to calculate transformations based on user interactions.

Member Functions

Sets a custom time provider function that returns the current time in seconds.
This is essential for synchronizing time-dependent behaviors within the Grabbable object.
Parameters
timeProvider
A function delegate that returns the current time in seconds.
Implementation of IPointableElement.ProcessPointerEvent(PointerEvent); for details, please refer to the related documentation provided for that interface.
Injects an optional one-hand transformer component to be used when the object is grabbed with one hand.
Parameters
transformer
The transformer component that defines how the object behaves when grabbed with one hand.
Injects an optional two-hand transformer component to be used when the object is grabbed with two hands.
Parameters
transformer
The transformer component that defines how the object behaves when grabbed with two hands.
Sets an optional target transform to which all transformations will be applied, instead of the object this component is attached to.
Parameters
targetTransform
The transform component that should receive all transformations.
Injects an optional Rigidbody component to be controlled by this Grabbable object.
Parameters
rigidbody
The Rigidbody component to be manipulated during grab interactions.
///
Configures whether the object should simulate throwing physics when unselected based on user interactions.
Parameters
throwWhenUnselected
A boolean value indicating whether to apply throwing dynamics when the object is released.
Determines whether the Rigidbody should be locked to kinematic mode while the object is selected.
Parameters
kinematicWhileSelected
A boolean value indicating whether to lock the Rigidbody to kinematic mode during selection.

Protected Functions

virtual void Reset ( )
virtual override void Awake ( )
virtual override void Start ( )
virtual override void OnDisable ( )
virtual void OnDestroy ( )
virtual override void PointableElementUpdated
( PointerEvent evt )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon