Build your first VR game with Oculus Quest and Unity — Part 1
Source
This pandemic sheltering could drive people to think of the usage of Mixed reality (XR) a step ahead of SciFi movies. In brief, XR is the symbiosis of Virtual Reality (VR) and Augmented Reality (AR). These technologies have the potential of creating its own ecosystem where it will change how we learn, do business, interact with others just like social media did a few decades ago. Thus, the days will not be far away that we might use an OASIS to escape the desolation of the real world. However, this is more of personal speculation than the reality at the moment.
Nevertheless, this article series (Part 1, 2 and 3) is nothing about my speculation or scepticism but simply about how to build a simple VR game (A Six-pin bowling game — Variation of Nine-pin bowling game which is known as Kegel). They say that "A journey of a thousand miles begins with a single step". Thus, regardless of so-called Metaverse will ever exist, this is just for fun and for you to be in par with the latest tech in the world.
Variation of Kegel (Six-pin bowling)
VR is a tool for anyone, who likes to turn any space into an immersive environment. The barrier of entry to this technology is not as hard as you might think. In my two articles (Part 1 and Part 2), I will guide to build a complete VR game without writing a single line of code. Yes, you read it correctly. Let's get started.
Trending AR VR Articles:
1. Oculus Go, the Nintendo Switch of VR
2. Expert View: 3 ways VR is transforming Learning & Development
3. Ready Player One : How Close Are We?
4. Augmented Reality — with React-Native
Prerequisites
- Oculus Quest (I recommend to read my very short Article on how to enable developer mode on Oculus Quest before getting started)
- Unity version 2019.3.x (I am using version 2019.3.11f1 latest as of the time I write this article)
- Optionally Oculus Link cable (This is not mandatory)
Alright, first things first. If you have an Oculus Link cable then that would make your development faster and give you the ability to do debugging. However, this is not mandatory for this exercise.
Open Unity Hub and go to Installs and make sure you have version 2019.3.x and click on the three dots on Unity version and click Add Modules. See Figure 2 below.
Figure 2
Make sure Android Build Support is installed. Figure 3 below shows a screen capture of the necessary modules.
Figure 3
Once you have all that installed, go to Projects and click the drop-down icon next to New and select the version 2019.3.x with Android Build Support installed. After that select Universal Project Template under templates and give your project a name and a space to save as in Figure 4 below and click Create.
Figure 4
Your project windows should look like below in Figure 5. You can change the layout as you want by using the Layout button on the top right corner.
Figure 5
I prefer to use 'Tall' layout with the Game pane on the bottom as in Figure 6.
Figure 6
Now we are ready to get started. Click on the Scenes folder under Assets on the Project window. Then right-click and create a new scene as in Figure 7 below.
Figure 7
Give it a name. I named it as BowlingGameScene. Now double click on it to open it. See Figure 8 below.
Figure 8
Next, we need to install some Unity packages related to XR development. For this, go to Window-> Package Manager as in Figure 9.
Figure 9
Then, on the window that pops up, click Advanced and then select Show preview packages. Refer to Figure 10 below.
Figure 10
If you get a warning message from Unity Package Manager as in Figure 11 click Yes.
Figure 11
Scroll all the way down and select XR Interaction Toolkit preview and click install. Refer Figure 12.
Figure 12
After installation finishes, close the Package Manager Window. Next, go to Edit and select Project Settings... Refer to Figure 13 below.
Figure 13
In the Project Settings pop-up window, go to XR Plugin Management and click on Install XR Plugin Management.
Figure 14
After that, under standalone settings tick Oculus. And under Android, again tick Oculus. Refer to Figures 15 and 16 below. This will install necessary assets for us to develop our game and then to deploy in the Oculus.
Figure 15Figure 16
After that, close the Project Settings window. Next, go to Window and Asset Store.
Figure 17
Next search for Bowling: Kegel & Ball and select assets set and then click Download and Import. Optionally you might be asked to sign in to Unity if you haven't already. Refer to Figure 18, 19 and 20.
Figure 18Figure 19Figure 20
Then click All and then Import on the pop-up window. Refer to Figure 21.
Figure 21
Now click on the Scene pane which is near the left top corner. Then go to Hierarchy panel and right-click on the Main Camera and click Delete. Refer to Figure 22 below.
Figure 22
If you follow all the steps up to this point then your Unity view should be similar to Figure 23 below. Please note that there should be an additional folder named Oculus (as in Figure 25) if you download and import Oculus Integration.
Figure 23
One more step. Go to File -> Build Settings… Once the 'Build Setting' window pop-up, click Add Open Scenes button to add the BowlingGameScene. Remove any other scenes that are there in "Scenes in Build" section. Refer to Figure 24 below.
Figure 24
After that, under the Platform section select Android and then click Switch Platforms. Once the process is complete, close the 'Build Settings' pop-up window. Refer to Figure 25.
Figure 25
Alright! You are done with all the configurations and settings that are necessary to start building your game. Now it's time to get started in building the game. As this article got very long, I decided to split the article to set up and build into three parts.
Please continue reading to Build your first VR game with Oculus Quest and Unity — Part 2.
See you in the next article!
If you want to thank me or if you like the article;
Cheers!
Don’t forget to give us your 👏 !
https://medium.com/media/1e1f2ee7654748bb938735cbca6f0fd3/href
Build your first VR game with Oculus Quest and Unity — Part 1 was originally published in AR/VR Journey: Augmented & Virtual Reality Magazine on Medium, where people are continuing the conversation by highlighting and responding to this story.