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
Here is where we begin our XR experience journey! You should have the tools you need installed – if not, see the previous blog article in this series. We’ll be setting up a completely new XR experience, from beginning to end. This may seem like a lot, but take it one section at a time – the payoff is well worth it…
Full Step-by-Step Instructions!
Goals…
- Create a New Project
- Setup Unity Environment
- Adding Meta XR All-In-One SDK
- Configure Project
- Configure for Building on Android
- Setting up our XR Scene
- Setup our “Hello Cube!”
- Build and Run
![](/wp-content/uploads/2023/07/image-78.png)
Download the finished code for this blog article @ Github Repo
Creating a New Project
Let’s start by creating a new Universal 3D project in Unity Hub with our latest version of Unity.
- Open Unity Hub and click New Project
![](/wp-content/uploads/2024/07/image-8-1024x600.png)
- (New Project Window) -> Editor Version
- Select the latest version of 2022 in the drop down
![](/wp-content/uploads/2024/07/image-9-1024x600.png)
- (New Project Window) If you DO NOT have the Universal 3D template already installed
- (Templates) Click the Universal 3D template
- Click Download template
![](/wp-content/uploads/2024/07/image-10-1024x600.png)
- (New Project Window)
- (Templates) Click the Universal 3D template
- (Project Name) Name your XR project
- (Location) Pick the directory in which you want the project to be created
- (Project Settings) Unclick the Connect to Unity Cloud (not using it in this project)
- Click Create Project
![](/wp-content/uploads/2024/07/image-11-1024x600.png)
Setup Unity Environment
Now that we have a new project lets see what the Unity environment looks like and configure the layout.
- Creating a project takes a couple of minutes – as the base projects are pretty large (~1.2GB) — here’s what we get!
![](/wp-content/uploads/2024/07/image-12-1024x576.png)
<Pro-Tip>
- (Toolbar) Window -> 2. Layouts -> 3. Wide
- There are several different layouts of your Unity windows, I prefer “Wide” layout – but find the one that you love!
![](/wp-content/uploads/2024/07/image-13-1024x576.png)
</Pro-Tip>
- So we’re all talking about the same things, here are the parts of the Unity Window
![](/wp-content/uploads/2023/07/image-25-1024x576.png)
Adding Meta XR All-In-One SDK
What a difference a year makes – looking back at last years how to build a Meta Quest XR experience there were a LOT more steps. This year, Meta has released the Meta XR All-in-One SDK which speeds up our development by leaps and bounds — here’s how to install it.
- Open up the Unity Asset Store — https://assetstore.unity.com/ and search for “Meta XR All in one” and you will find the following.
- If for some reason you can’t find it – here’s the direct link to Meta XR All-in-One SDK
- IMPORTANT NOTE – we are using v66 (latest at the time of writing this series) – between versions you will likely find changes — ie. where things are, what they are called, new blocks, some blocks depreciated. Will keep things as up to date as possible 🙂
- As long as you’re logged in to the website, click -> Add to My Assets
![](/wp-content/uploads/2024/07/image-16-1024x586.png)
- Accept the License Agreement
- Click Open in Unity
![](/wp-content/uploads/2024/07/image-17-1024x586.png)
- Click Install
![](/wp-content/uploads/2024/07/image-57-1024x539.png)
- Up to you, but I generally share my usage with Meta to make the products better (this may or may not come up for you)
![](/wp-content/uploads/2024/07/image-19-1024x539.png)
- Click on Restart Editor
![](/wp-content/uploads/2024/07/image-20-1024x539.png)
Now the new Meta All-in-One SDK is added to your project!
Configure Project
Next we need to setup the project to run on our Oculus Meta headset using the new Meta XR configuration wizard, that makes it a lot easier to make sure we don’t miss any settings – huge improvement of the way we did this in the past.
- Click the Meta icon in bottom right corner
- Click Project Setup Tool
![](/wp-content/uploads/2024/07/image-23-1024x576.png)
- (Project Settings) Click XR Plug-in Management
- Click Install XR Plugin Management
![](/wp-content/uploads/2024/07/image-24-1024x576.png)
A couple pop-up boxes may appear, and one will likely ask you to restart the app – do so
- (Project Settings) Click XR Plugin-in Management
- Click the Windows, Mac, Linux settings tab
- (Windows, Mac, Linux settings tab) Click Oculus checkbox
![](/wp-content/uploads/2024/07/image-25-1024x576.png)
- Click the Android tab
- Click Oculus
![](/wp-content/uploads/2024/07/image-26-1024x576.png)
- (Project Settings) Click XR Plug-in Management -> Oculus
- (Android tab) Click the Oculus 3 checkbox
![](/wp-content/uploads/2024/07/image-27-1024x576.png)
- (Project Settings) Click Meta XR
- (Project Setup Tool) Click the Android settings tab
- (Android settings tab) Click Fix All
- (Android settings tab) Click Apply All
![](/wp-content/uploads/2024/07/image-60-1024x582.png)
- Should end up with everything fixed/applied
![](/wp-content/uploads/2024/07/image-59-1024x582.png)
- (Project Setup Tool) Click the Windows, Mac, Linux settings tab
- (Windows, Mac, Linux settings tab) Click Fix All
- (Windows, Mac, Linux settings tab) Click Apply All (if needed)
![](/wp-content/uploads/2024/07/image-61-1024x582.png)
- Should end up with everything fixed/applied
![](/wp-content/uploads/2024/07/image-62-1024x582.png)
- (Android tab) Do the same, Fix All and Apply All
![](/wp-content/uploads/2024/07/image-32-1024x576.png)
Configure for Building on Android
Unity can be used to build across a wide variety of devices, we need to change it to build for Android – which is the hardware running in the Meta Quest.
- (Toolbar) Click File
- (File) Click Build Settings…
![](/wp-content/uploads/2024/07/image-63-1024x582.png)
- (Build Settings) -> Platforms -> Click Android
- (Build Settings) -> Click Switch Platform
![](/wp-content/uploads/2024/07/image-34-1024x576.png)
Setting up our XR Scene
We’ve done all the configurations! Woohoo way to go 🙂
Now we want to start setting up our scene. Think of a scene as a level in a game -or- the stage on which we will adding scenery for our play – including the camera through which we will view the stage.
We need to start by cleaning up our scene, and deleting the old Main Camera and Global Volume
- (Hierarchy) Click Main Camera -> hit the DEL key to delete it!
- (Hierarchy) Click Global Volume -> hit the DEL key to delete it!
![](/wp-content/uploads/2024/07/image-35-1024x576.png)
- You should be left with just Directional Light
![](/wp-content/uploads/2024/07/image-36-1024x576.png)
Let’s look at all the new Building Blocks!
Wow – this approach has made adding features to our Meta project so much easier – and as new features are rolled out they’ll just keep adding more blocks!
- Click the Meta icon in bottom right corner
- Click Building Blocks
![](/wp-content/uploads/2024/07/image-38-1024x576.png)
![](/wp-content/uploads/2024/07/image-39-1024x576.png)
- (Building Blocks) Click the Add Block for the Camera Rig
- This will add a new Camera Rig directly into our Hierarchy – it has a ton of already added features that we can explore more in-depth in future tutorials — but know that not long ago we needed to setup all this one piece at a time. Look back at previous year’s XR Step-by-Step tutorials if you’re so inclined — that or live in the NOW and just click the button to add it. 🙂
![](/wp-content/uploads/2024/07/image-40-1024x576.png)
- (Building Blocks) Click the Add Block for the Controller Tracking
- We want to be able to see our controllers and use them to grab objects!
![](/wp-content/uploads/2024/07/image-41-1024x576.png)
- (Building Blocks) Click the Add Block for the Grab Interaction
- That’s right we’re making “hello cube” and “this is the cube you’re looking for”!
![](/wp-content/uploads/2024/07/image-42-1024x576.png)
- Note!
- Adding some blocks brings in other blocks they need!
- This is really the power of using block, it speeds up our project setup by a lot!!
- (Hierarchy) Click Camera Rig -> (Inspector) See everything that Grab Interaction brought in…
- Controller Interactions
- Virtual Hands
- Interaction
- Hand Tracking
- Hand Interactions
- …and of course Grab Interaction
![](/wp-content/uploads/2024/07/image-66-1024x576.png)
<Pro-Tip>
- It’s hard to see your objects in the scene with what Unity calls Gizmos (like the giant white camera icon) over the top of them. Click the Gizmo icon at the top right of the Scene Window to turn them off.
![](/wp-content/uploads/2024/07/image-67-1024x576.png)
- Now we can see everything!
![](/wp-content/uploads/2024/07/image-68-1024x576.png)
</Pro-Tip>
- Always after adding Building Blocks we want to check our Project Setup Tool to see if there are any fixes we need to apply.
- Click the Meta icon in bottom right corner
- Click Project Setup Tool
![](/wp-content/uploads/2024/07/image-43-1024x576.png)
- (Android tab) Click Apply All
![](/wp-content/uploads/2024/07/image-69-1024x576.png)
Setup our “Hello Cube!”
….Yes, my version of “Hello World!”
We have most of what we need but let’s color our cube and make put it where we can grab it!
- (Hierarchy) Double-Click on Cube
- The scene should zoom in on the cube and you should see that it’s pink?!? Pink in this case means that it doesn’t have a material applied.
- Let’s make a new red colored material and paint our cube with it!
![](/wp-content/uploads/2024/07/image-46-1024x576.png)
- We want to start by creating a new folder for our materials named “_Materials”
- Noting I put an “_” character in front of the folders that I want to at the top of the list of folders
- (Project) Right-Click in the file section -> 2. Create -> 3. Folder
![](/wp-content/uploads/2024/07/image-47-1024x576.png)
- (Project) Click on the _Materials folder
- (Project) Right-Click in the file section -> 3. Create -> 4. Material and name in Red
![](/wp-content/uploads/2024/07/image-48-1024x576.png)
- (Project) Click our new material Red
- (Inspector) Click Base Map
- (Color) Move the circle to a shade of red that you like!
![](/wp-content/uploads/2024/07/image-49-1024x576.png)
- (Project) Just drag the Red material onto the pink cube and it should turn red 🙂
![](/wp-content/uploads/2024/07/image-50-1024x576.png)
- (Hierarchy) Click Cube
- (Inspector) -> Transform -> Position -> Change Y to 1
- (Inspector) -> Transform -> Position -> Change Z to 0.6
- (Hierarchy) Double-Click Cube to see it’s new position in the scene
- We’re doing this so when we run the application that the cube is in raised up in front of us and we can grab it!
![](/wp-content/uploads/2024/07/image-52-1024x576.png)
- (Hierarchy) Click on Camera Rig
- (Inspector) OVR Manager (Script) -> Click Quest 3 checkbox
![](/wp-content/uploads/2024/07/image-70-1024x576.png)
Build and Run
Let get this running on our device!
- (Toolbar) Click File
- (File) Click Build Settings…
![](/wp-content/uploads/2024/07/image-53-1024x576.png)
- (Build Settings) Click Run Device -> If your Quest is connected to your computer, and you’ve given it permissions – you should see your device
- (Build Settings) Click Build and Run
![](/wp-content/uploads/2024/07/image-54-1024x576.png)
- You need to choose where you want to build your file to…
- I generally create a “_Builds” folder at the same level in the file structure that you saved your project to – and then name the build file “App”
- (File Explorer Window) Create a new folder “_Builds” and under that create another folder matching the name of your project, so “QuestXR” in this case
- (File Explorer Window) -> File name -> Enter “App” as the name
- (File Explorer Window) -> Click Open
![](/wp-content/uploads/2024/07/image-56-1024x576.png)
Success!
Look at that! You’ve built “Hello Cube!” and you’re seeing it on your Quest!!!
Congratulations for all your hard work – you’re now part of a very select group of geeks that have build their very own XR experience. 🙂
![](/wp-content/uploads/2024/07/Lab-2-Moving-Block.gif)
- Note, you should also see your HANDS and be able to grab things the same way you can with the controllers!!!
I always love feedback and suggestions for new XR / AI blog posts!
Go build something amazing in XR & AI! — Lance 🙂
Check out other blog articles in this (and other) series!
Quick links to Lance’s latest XR Step-by-Step blog articles by device