Codeless VR Door And Drawer with the XR Interaction Toolkit

Опубликовано: 03 Май 2026
на канале: XR Terra Class
860
28

This video uses a couple of exercises to introduce you to combining Physics Joint components with the XR Interaction Toolkit in Unity. In our first exercise we make a VR Door, covering the Hinge Joint, Velocity Tracking on the XR Grab Interactable, setting limits, using a Fixed Joint as a doorknob, and how to use the XR Socket Interactor to snap the door shut. In our second exercise we make a VR Drawer, covering how to disable collisions between layers, and how to get linear limits from the Configurable Joint.

XRTerra Links:
Programs and Courses: http://www.xrterra.com/programs
Newsletter Signup: https://www.xrterra.com/mailing-list-...

Colliders And Rigidbodies in Unity:    • Colliders And Rigidbodies in Unity  
Your First VR Scene with the XR Interaction Toolkit in Unity:    • Your First VR Scene with the XR Interactio...  
XR Device Simulator 2.3.0 And Later:    • XR Device Simulator 2.3.0 And Later  
Physics Joints in Unity:    • Physics Joints in Unity  

00:00 Intro and prerequisites
00:46 Setting up VR Scene
01:06 Setting up Door Hierarchy structure
02:00 Keeping physics components and models separate
02:56 Grab interactable door
03:09 Setting movement type to Velocity Tracking
04:18 Testing out grabbable object
04:39 Disabling Force Grab
05:17 Testing out interaction at a distance
05:57 Adding a Hinge Joint component
06:19 Adjusting hinge axis and anchor
07:14 Testing hinge joint
07:33 Limiting the hinge
08:38 Prevent door being pulled off of hinge with velocity scale
10:18 Creating a Doorknob
10:57 Adding a Fixed Joint component to the doorknob
11:31 Moving XR Grab Interactable to the doorknob
12:13 Testing doorknob
12:37 Snapping the door shut
13:09 Creating an XR Socket Interactor
14:15 Testing door socket
15:16 Demonstrating snapped door physics immunity
16:00 Drawer
16:36 Showing off a drawer made of primitive cubes
17:16 Colliders are invisible, take advantage
18:30 Grab Interactable drawer
19:06 Preventing physics interactions we don't want
20:16 Creating a Drawer Physics Layer
21:15 Disabling physics interactions between Drawer and Default layers
22:15 Adding configurable joint
22:52 Configurable joint axes
24:58 Constraining joint axes
25:29 Testing joint constraints
25:53 Setting linear limit
26:09 Testing linear limit
26:21 Limits go both ways
26:39 Adjusting velocity scale to prevent physics glitching
27:29 You can use code to solve joint limit problems
28:01 Outro

Instructor: Gregory Osborne