Opening a Drawer in VR using a Fixed Joint and XR Grab Interactable

Suleiman Abdullah
2 min readNov 22, 2023

--

Objective: Opening a Drawer in VR using a Fixed Joint and XR Grab Interactable.

In the first step add a configurable joint in the drawer, lock z motion, y, and all rotation motion we need to allow movement in the z direction. but will set a limit of z motion in the Linear Limit option on the configurable joint.

Create a cube inside the drawer, adjust it to fit the drawer handle, and remove the mesh render.

Add Fixed Joint to this cube(I have renamed it handle), Select the handle<Fixed Joint, then drag the drop a top drawer to Connected Body option.

In this step Add XR Grab Interactable to the handle, and change the movement type to Velocity motion, you can uncheck rotation movement since our drawer locks all rotations on the Configurable joint but it’s not necessary.

This is how to use a Fixed Joint to Open a drawer in VR.

see you in the next one

--

--

Suleiman Abdullah
Suleiman Abdullah

Written by Suleiman Abdullah

Self taught Unity Developer, who is passion about making games ,and he loves Math For Game Development

No responses yet