Grabbing the (VR) World with Both Hands!
Objective: Set up a grabbable object that requires two hands!
Sometimes, even if we don’t want to, we have to use both of our hands. In this tutorial we are going to learn how to set up objects in your VR environment to allows two hands to interact with an object at the same time.
To begin, we are going to be using a two-handed weapon. As we have done in the past, we have a collider on the parent object and a child object that holds another collider on the barrel.
Add the XR Grab Interactable component to the parent object. Unlike a one handed weapon we are going to add two colliders. First the parent collider and then the collider on the child object.
We need to make another change. The Select Mode, and the Focus Mode. The select mode can be either single selection with swapping allowed or multiple selection. Select multiple so we can put two hands on this weapon.
When making a single-handed weapon we would make an empty object to be out attach point. When creating a two-handed weapon, we need two attach points. create your first point, duplicate it and place the second one where you want your second hand to attach.
Now we drag these points into the grab interactable.
From here you can now grab your object with both hands. The best part is you don’t have to worry about which hand to grab with first. If you left-handed grab with your left hand first it works both ways! Don’t be afraid to experiment with your two-handed objects in your VR environment, and I’ll see you in the next tutorial!