Drawer Breakdown
Similar to our door, we have a breakdown of our drawer with each side of the drawer as well as the handle.
We'll add an XR Grab Interactable script to the handle which is the parent of all the sides of the drawer. Therefore we'll add the handle as our collider to the XR grab interactable
The Joint
This time we will use Configurable Joint so that we can only move the drawer on the X-axis. We want to set our axis to X: 0 , Y: 0 and Z: -1 because we want the drawer to move backward on the Z-axis as seen in the photo below.
Next, we need to lock all the motion except on the X motion.
Finally, we need to limit the drawer movement so it can't go out forever.
Dampening the drawer is an optional choice.
Note
We now have a working drawer; however, there's a snapping motion that happens once you try to grab the drawer initially. What's happening is that it snaps to where the controller is. One fix to the issue would be to create a sub-class of XR Grab interactable and set an offset to the controller when grabbing things. In another blog post, we can visit how to do that.