Grabbing Distant Objects in MetaQuest

0. Contents of This Article

This article introduces how to grab and manipulate distant 3D objects (cubes) with Meta Quest. This video is the AR version but supports both AR/VR.
You can also check the operation in the 03-FarManipulation or 03-FarManipulation-AR scene of the sample published on GitHub.

FarInteraction

This article assumes that the preliminary preparations in the following article have been completed. Please note this.

[Preparation Edition]

Grabbing Objects in MetaQuest (Preparation)

1. Duplicating the Scene

While it's possible to edit the scene created in the previous article, to try manipulation without destroying the existing scene, I'll introduce how to duplicate the scene. Skip this if unnecessary.

  • Open the Manipulation or NearManipulation VR or AR scene created in previous articles
  • Click File -> Save As... to save the current scene with a new name
    This article uses *FarManipulation
  • Confirm that the scene name displayed in Hierarchy is FarManipulation

2. Settings for Grabbing Distant Objects with Controllers or Hands

I'll introduce the scripts to add and their configuration methods for cases when using controllers or hands to grab objects. By configuring both, you can use both controllers and hands.

[Grabbing with Controllers]

  • Display Cube's Inspector and click Add Component
  • Search for Grab Interactable and select Distance Grab Interactable from candidates
  • Drag and drop Cube to Pointable Element in the added Distance Grab Interactable
    *Connects Distance Grab Interactable and Grabbable, reflecting controller grab information to the behavior set in Grabbable (position, rotation, scale changes)
  • Further drag and drop Cube to Rigidbody in Distance Grab Interactable
    *By assigning the Rigidbody added to Cube in the previous article, contact detection between controller pointer and Cube is utilized

Distance Grab Interactable Settings Screen

[Grabbing with Hands]

  • Display Cube's Inspector and click Add Component
  • Search for Grab Interactable and select Distance Hand Grab Interactable from candidates
  • Drag and drop Cube to Pointable Element in the added Distance Hand Grab Interactable
    *Connects Distance Hand Grab Interactable and Grabbable, reflecting hand grab information to the behavior set in Grabbable (position, rotation, scale changes)
  • Further drag and drop Cube to Rigidbody in Distance Hand Grab Interactable
    *By assigning the Rigidbody added to Cube in the previous article, contact detection between hand pointer and Cube is utilized

Distance Hand Grab Interactable Settings Screen

[Note!]

If ControllerOnly is selected in Hand Tracking Support of OVR Manager attached to the OVRCameraRig object, hand tracking won't work and you won't be able to grab objects with hands. Please check the settings.

3. Current Status Check and Behavior Modification

The following video shows the behavior of content created with the operations so far. (For controller grabbing, use the middle finger grip button.)

As you can see, the default Meta XR SDK setting is to pull distant objects towards you, which differs from the behavior shown in the opening video.
While this may be fine for some content, there are cases where you want to change only the position without pulling objects towards you, so I'll introduce how to achieve this.

FarInteraction1

[Object Behavior When Grabbed]

  • Select Cube and click Add Component at the bottom of the Inspector
  • Search for Move From and select Move From Target Provider to add

About Behavior Differences:

  • Default: Objects move to controller or hand position before manipulation begins
  • After Change: Objects can be manipulated while maintaining their original position

Use Move From Target Provider with the following steps to set objects to maintain their original position.

[Behavior Adjustment for Controller Use]

  • Pay attention to Distance Grab Interactable in the Inspector
  • Open Optionals
  • Drag and drop Cube to Movement Provider to associate the Move From Target Provider registered to this Cube

[Behavior Adjustment for Hand Use]

  • Pay attention to Distance Hand Grab Interactable in the Inspector
  • Turn Reset Grab On Grabs Updated to OFF
  • Open Optionals
  • Drag and drop Cube to Movement Provider to associate the Move From Target Provider registered to this Cube

4. Fine-tuning Controller Settings (Optional)

The above operations enable grabbing and moving objects with controllers. By default, the grip button (middle finger) is used for grabbing. Here's how to enable grabbing with the trigger button as well.

  • Open the OVRInteractionComprehensive child element of OVRCameraRig in the Hierarchy
  • Further open child elements in this order: RightInteractions -> Interactors -> Controller and No Hand -> ControllerDistanceGrabInteractor
  • Open the GripButtonSelector child element of ControllerDistanceGrabInteractor
  • Pay attention to ControllerSelector in GripButtonSelector's Inspector
  • Turn ON the TriggerButton checkbox in Controller Button Usage
    *Turn off the GripButton checkbox if GripButton is not needed
  • Perform the same operation for the left hand controller (LeftInteractions) to set the button used for grabbing

Trigger Manipulation

5. Fine-tuning Hand Behavior (Optional)

This is a detailed point, but by default when scaling Cube with both hands, the hand objects fly towards the Cube. If you want the hand objects to follow the actual hands, try the following.

  • Select Cube in the Hierarchy
  • Pay attention to Distance Hand Grab Interactable registered to Cube in the Inspector
  • Change Hand Alignment setting to None

6. Next Steps

You've now achieved grabbing and manipulating distant objects. You can also combine distant and nearby object manipulation for the same object.

If you want to add nearby object manipulation, follow the procedures from chapter 2 of the next article.

Grabbing Nearby Objects in MetaQuest

7. Complete List of Meta XR SDK Articles

Meta XR SDK Series Index

0
Subscribe to my newsletter

Read articles from Takashi Yoshinaga directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Takashi Yoshinaga
Takashi Yoshinaga