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

GrabInteractable Class

The GrabInteractable class enables objects to be grabbable by controllers, provided they are within arm's reach.
This class implements interfaces for handling rigidbody physics and collider references, facilitating detailed control over the interaction dynamics.

Fields

Collider [] Colliders[Get]
Provides access to the Rigidbody component associated with the interactable object, allowing for physics-based interactions.

Properties

Determines whether the closest point to the interactor should be used as the grab source, enhancing precision in grab interactions.
Specifies the distance at which the object will automatically be released from the grab, providing a limit to maintain realistic interactions.
Indicates whether the grab should be reset when the grab points are updated, allowing for dynamic adjustment during ongoing interactions.

Protected Functions

override void Awake ( )
override void Start ( )

Member Functions

Calculates the grab source position for a given target, which determines the initial location from which the object will be grabbed.
Parameters
target
The pose of the interactor targeting the grabbable object.
Returns
The calculated Pose representing the grab source.
Applies specified linear and angular velocities to the interactable's Rigidbody, if it has one, facilitating realistic physics interactions.
Parameters
linearVelocity
The linear velocity to apply.
angularVelocity
The angular velocity to apply.
Adds a Rigidbody to a dynamically instantiated GameObject.
Adds a Rigidbody to the interactable, enabling physics interactions.
Parameters
rigidbody
The Rigidbody to be added to the interactable object.
Optionally sets a specific transform as the grab source for the interactable, allowing for customized grab initiation points.
Parameters
grabSource
The transform to be used as the grab source.
Optionally sets a specific release distance for the interactable, defining how far the interactor can move before the grab is released.
Parameters
releaseDistance
The release distance to be set.
Optionally adds a PhysicsGrabbable component to the interactable, which is now deprecated and should be replaced with Grabbable.
Parameters
physicsGrabbable
The PhysicsGrabbable component to be added.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon