Getting a Handle on Things!

addam davis
3 min readJun 7, 2024

--

Objective: Understanding how to manipulate a configurable joint using a fixed joint.

Here’s the scenario, we have a file cabinet. The drawer is controlled by a configurable joint. A configurable joint is a joint component that incorporates all the functionality of the other joint types and is used to provide greater control of character movements. In this specific situation it is constraining the drawer from only moving on the Z axis as well as only allowing it to move a specific distance.

Since we are working in the VR space, we are going to need to need to make this drawer a grabbable object wo we can interact with it and retrieve the key from inside. Unfortunately, we cannot simply make the drawer itself a grabbable object. this will negate the configurable joint and attach the drawer to the player’s hand.

Instead, we need to create a child object on the drawer. This object should be the size of the handle. Before we can make this a grabbable object we need to add a fixed joint component. A fixed joint restricts an object’s movement to be dependent upon another object. This will allow use to keep the restraints given to the drawer by the configurable joint.

In this scenario we want to make sure that the rigidbody that was created with the fixed joint is not using gravity. The connected body is also going to be the parent object, in this case, the drawer.

At this point if we were to play the editor, we could now pull the drawer using the handle.

Hurray! Now all we are left with is adding the XR Grab Interactable component to the handle object. From here you can now grab the drawer in VR. You now know how to properly set up joints in your scenes. Don’t be afraid to experiment with your joints and I’ll see you in the next tutorial!

--

--

No responses yet