Mastering Unity XR: Understanding Grab Attach Points in XR Grab Interactable Component

Damian Dąbrowski
3 min readMar 28, 2024

Creating intuitive and immersive interactions in virtual reality often hinges on the details, such as where and how objects attach to the player’s virtual hands. In Unity’s XR Toolkit, the XR Grab Interactable component is a crucial element for crafting these experiences. In this article, we’ll explore how to determine the grab attach point and delve into the attach options available within the XR Grab Interactable component.

The Importance of Grab Attach Points

A grab attach point defines the position and rotation of an object when it’s picked up in VR. It ensures that the object feels natural and intuitive when interacted with, enhancing the player’s sense of presence. The grab attach point can be the difference between an object that feels awkward and one that feels like an extension of the player’s own hand.

Setting Up the Grab Attach Point

To get started, you need to have an XR Grab Interactable component added to your interactable object. Here’s how you can determine the attach point:

  1. Select your interactable object in the Unity Editor’s hierarchy.
  2. In the Inspector, find the XR Grab Interactable component.
  3. Look for the ‘Attach Transform’ field. This is where you will specify the grab attach point.

If you leave the ‘Attach Transform’ field empty, the object’s center will be used as the default grab point. However, for a more refined interaction, you can create an empty GameObject as a child of your interactable object, position it where you want the hand to grab, and then drag that GameObject into the ‘Attach Transform’ field.

Exploring Attach Options

Within the XR Grab Interactable component, there are several options you can configure to fine-tune how the object behaves once grabbed:

  • Attach Ease In Time: This option allows the object to smoothly transition into the hand’s position and rotation over a specified duration. It’s useful for adding a more natural movement to the grab action.
  • Movement Type: This determines how the object will move once it’s grabbed. You can choose between ‘Instantaneous’, ‘Velocity Tracking’, and ‘Kinematic’. Each type provides a different feel, ranging from immediate attachment to a more physics-driven response.
  • Velocity Damping and Angular Velocity Damping: These settings are available when using ‘Velocity Tracking’ movement type and help to smooth out the motion of the object, providing a more realistic interaction.
  • Track Position and Track Rotation: These toggle options dictate whether the object should follow the position and rotation of the controller. Depending on your desired interaction, you may want one or both enabled.
  • Throw On Detach: When enabled, this allows the object to maintain its velocity when released, enabling throwing mechanics.

By experimenting with these attach options, you can create a wide range of interactive behaviors for your VR objects, from rigid swords that snap to the player’s hand to flexible tools that require a more nuanced grip.

Conclusion

Understanding and utilizing the grab attach point and attach options in Unity’s XR Grab Interactable component is essential for creating realistic and satisfying interactions in VR. Take the time to experiment with different settings to find the perfect balance for your VR objects. With practice, you’ll be able to design interactions that feel as natural as they are engaging.

I hope this guide has illuminated the path to creating better VR interactions in Unity. If you have any further questions or would like to share your experiences with grab attach points, please drop a comment below!

--

--

Damian Dąbrowski

Hi, I’m Damian, a Software Engineer who loves building educational apps and simulations..