Getting A Handle On Things

Samantha Gittemeier
3 min readNov 27, 2023

--

Now that I’ve completed the shooting range in my pentathalon project, we’re going to move onto the escape room portion. This is where we’re going to learn about using Socket Interactables. But first, we need to get a couple other things set up.

First, in the escape room portion, we have a drawer that our key inside of it. We need to make it so that we can grab this drawer. Currently, our drawer is using a Configurable Joint component to give it movement that is more aligned with that of a drawer. Using this configurable joint allows us to restrict any angular movement of the drawer as well as the movement in the x and y axis. Then we have limited the movement for the z axis so the drawer can only move so far in the forward direction.

Now we only want to grab the drawer by its handle, so you’d think we could add a collider and grab interactable component to the drawer itself if we really wanted to, but if we did that, it would actually cause us to pick up the entire drawer!

So instead, I’m actually going to create a new child of my drawer and call it Handle and I’m actually first going to use a Fixed Joint component to join this handle to the drawer. I can join the handle to the drawer by then dragging in my top drawer into my Connected Body slot on my Fixed Joint and this will join my handle to the top drawer Rigidbody component.

Now we can open the drawer in play mode within Unity just to confirm that the handle is in fact joined to our drawer and our drawer movement is still limited as before. Next, we can add our Grab Interactable component to our handle so we can actually grab it in VR and open the drawer.

To do this I did as we have been and added the box collier of my handle to my Colliders list. I also decided to turn on the Smooth Position setting but turned off the Track Rotation since this won’t be rotating anyways and I kept my Select Mode as Single since this handle doesn’t need to be grabbed with both hands. And just like that I can now grab the handle in VR and open my drawer!

--

--