Virtual Reality (VR), Augmented Reality (AR), Mixed Reality (MR) and now Spatial Computing all come together as XR or “Extended-Reality”.
You’re in the right place at the right time to build something amazing in XR!
In this blog post series we will focus on Meta Quest!
Check out other blog articles in this (and other) series!
Quick links to Lance’s latest XR Step-by-Step blog articles by device
Previously we setup our project and added both hands and controllers, now let’s add more things to interact with — we call these interactables. We’ll be adding Grab Interaction, Distance Grab, Poke Interaction and Throwable Items!
Add More Colored Materials
First was want to add some more materials that we can use to color our objects — so as a reminder here is how to add a material – I’ll add blue – then do the same to add green, black and white.
- (Project) Click _Materials folder
- (Project Files) Right-Click to bring up the menu
- (Menu) Create -> 4. Material
- (Project) Click the Material that you just created and named
- (Inspector) Click Base Map
- (Color) Drag the cursor to the color you want!
Add a Floor
Add a surface to walk, teleport and bounce items off!
- (Hierarchy) Right-Click to bring up the menu
- (Menu) Click 3D Object -> 3. Plane
- (Hierarchy) Click the Plane
- (Project) Drag Black on to the Plane in the Scene window
- (Inspector) Change the Position to 0, 0, 0 for X, Y, Z
Add Grab interaction
Same as we did at the end of our project setup, let’s add another cube that we can reach out and grab.
- Click the Meta icon in the bottom right corner of the screen
- Click Building Blocks
- (Building Blocks) Click the Gear icon
- Click Show Depreciated blocks
- We’re doing this as the Throwable Item is currently depreciated as they added a click box in the Grab Interaction that is “supposed” to provide the throwable functionality — haven’t figured out yet why it’s not working for me… if you figure it out – let me know!
- (Building Blocks) Click the Interaction filter — just makes it easier to get to the interactable items
- (Building Blocks) Click Add Block for Grab Interaction
- (Hierarchy) Click your new Cube
- (Project) Drag the Blue material onto your new Cube
- (Inspector) Change the Position to 0.2, 1, 0.6 for X, Y, Z — this puts it next to our other cube
Add Distance Grab
Think of this like a “force grab” from Star Wars – you point your hand at the object – and click – and it flies to your hand. Awesome addition is that they show an transparent version of the object in your hand before you distance grab it!
- (Building Blocks) Click Add Block for Distance Grab
- (Distance Grab) Couple options for Mode — let’s choose Pull Interactable To Hand for now – but encourage you to add more blocks with each Mode type
- (Distance Grab) Click Confirm
- (Hierarchy) Click your new Cube
- (Project) Drag the Green material onto your new Cube
- (Inspector) Change the Position to 0.4, 1, 0.6 for X, Y, Z — this puts it next to our other cubes
Add Throwable Item
One of my favorite things to do in XR is to experience physics between objects – no better way to do that than to be able to pick something up and throw it… 🙂
- (Building Blocks) Click Add Block for Throwable Item
- (Hierarchy) Click your new Throwable Item
- (Project) Drag the White material onto your new Throwable Item
- (Inspector) Change the Position to 0.6, 1, 0.6 for X, Y, Z — this puts it next to our other cubes
Add Poke Interaction
The poke interaction is in essence a button, but can be any object that you poke and something happens!
- (Building Blocks) Click Add Block for Poke Interaction
- (Hierarchy) Click your new Throwable Item
- (Project) Drag the White material onto your new Throwable Item
- (Inspector) Change the Position to 0.6, 1, 0.6 for X, Y, Z — this puts it next to our other cubes
Try them out!
Note — having some issues with the Throwable Item (probably because it’s depreciated and scripts have changed in the newest version <grin>) — but everything else works great. I’ll be working on getting throwable working and will be posting updates.
Run it and try!