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

DistanceGrabInteractable Class

The DistanceGrabInteractable class allows an object to be grabbed from a distance.
It leverages a configurable IMovementProvider to control how the grab interactable aligns with the DistanceGrabInteractor when selected. This functionality facilitates the grabbing and manipulation of objects remotely.
A reference to an IPointableElement must be set in the Unity Inspector. The IPointableElement serves as a target for PointerEvents, which are generated by the DistanceGrabInteractor. These events are needed to trigger the distance grab interaction.

Properties

The colliders associated with this interactable, used for interaction detection.
These colliders define the physical boundaries of the interactable object, allowing it to be detected and interacted with by the DistanceGrabInteractor.
The Rigidbody component of the interactable object.
The rigidbody defines the physical behavior of the interactable, such as its movement and collision responses.
IMovementProvider MovementProvider[Get]
Forces a release on all other grabbing interactors when grabbed by a new interactor.
This feature ensures that the object is only held by one interactor at a time, preventing multiple controllers or hands from interacting with the same object simultaneously.
Gets the Transform that acts as the reference point for the interactable.
This property returns the transform that defines the origin or "relative to" point for the interactable's movement and positioning.

Protected Functions

virtual void Reset ( )
override void Awake ( )
override void Start ( )

Member Functions

Moves the interactable to the provided position.
Parameters
to
The target Pose to which the interactable will be moved.
Returns
An instance of IMovement that defines how the interactable should move to the target position.
Applies velocities to the interactable's PhysicsGrabbable component, if one is present.
This method allows the interactable to be thrown or moved with a specified angular and linear velocity after being released. This method is marked as obsolete and should no longer be used. Use Grabbable instead.
Injects a Rigidbody component into a dynamically instantiated GameObject, allowing for physics-based interactions.
This method is a wrapper that calls InjectRigidbody internally.
Parameters
rigidbody
The Rigidbody component to be assigned.
Directly assigns a Rigidbody to the private field of a dynamically instantiated GameObject.
Parameters
rigidbody
The Rigidbody component to be assigned.
Adds a grab source to a dynamically instantiated GameObject, defining the point of interaction for grabbing.
Parameters
grabSource
The Transform that represents the grab source.
Adds a PhysicsGrabbable to a dynamically instantiated GameObject.
This method is marked as obsolete and should no longer be used. Use Grabbable instead.
Parameters
physicsGrabbable
The PhysicsGrabbable component to add.
Adds a IMovementProvider to a dynamically instantiated GameObject, allowing you to add custom movement logic.
Parameters
provider
The movement provider to inject, which controls the movement logic.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon