Intro to VR
What is VR?
VR (Virtual Reality) is a computer generated simulation, in which we can interact with the environment. In order to do this, we use some specific electronic devices, such as googles and controllers. In this simulation, we are able to have a realist experience since we are able to interact with the virtual world as if from within. VR makes us see things which do not exist in reality.In real world, we can use VR to play games, simulate activities (such as driving when preparing for the driver license), visualise entire buildings (real estate can use virtual reality guides through their appartments) or, why not, treat specific conditions, such as anxiety, phobias or panic attacks (inside a virtual reality simulation, the user can face his greatest fears without being in danger).
How can we use VR apps?
Unfortunately, in order to be able to use VR apps, we need specific devices, which most of the times are quite expensive. 😥Among these devices, we can mention:
- Google Cardboard
![Google Cardboard](https://huge.academy/pluginfile.php/4258/mod_page/content/16/GoogleCardboard.jpeg)
- Oculus
![Oculus](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Oculus.jpg)
- HTC Vive
![HTC Vive](https://huge.academy/pluginfile.php/4258/mod_page/content/16/HTC%20Vive.jpg)
If I don't have a VR headset, can I still implement apps?
Yes, even though you don't have the necessary hardware, you can still implement and test VR apps. Of course, the testing experience will not be as immersive as if having a headset, but at least you can see what you have implemented.
First of all, before we start implementing our own app, we need to make the set up for Unity.
1. We need support for Android or iOS. For this, follow the steps from here to install the needed features. Open Unity Hub, go to Installs, click on the three vertical dots of your Unity version, click on Add modules. Select Android Build Support, Android SDK & NDK tools and OpenJDK.![Unity Installs](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Unity%20Installs.png)
![Unity Settings](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Unity%20Settings.png)
![Unity Androoid Build Support](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Unity%20Android%20build%20support.png)
2. We also need Git for Unity (a feature which will help us download everything we need directly through Unity). With Unity and Unity Hub closed, download Git from here. Install it (remember where you have installed it) and then click on the Windows logo, type Environment Variables, open the Edit the system environment variables application, click on Environment Variables button, look in System variables after Path, click on it, then click on Edit button, click on New button and then type the location where Git is installed. Click on OK button until alll windows are closed.
![Git Download](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Git%20Download.png)
![Environment Variables Menu](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Environment%20Variables%20Menu.png)
![Environment Variables button](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Environment%20Variables%20button.png)
![Path](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Path.png)
![Add Git to path](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Add%20Git%20to%20path.png)
3. Now, we need to install the VR SDK. Follow steps 1-6 from here.
4. Then, we need to setup Unity project settings. If you have Android, follow these steps. Step 5 from Other Settings you need to write a name to the first two fields from here:
![Package name](https://huge.academy/pluginfile.php/4258/mod_page/content/16/Package%20name.png)
5. If you are having an Android phone, you need to enable debugging mode. Follow these steps.
6. Build you project: navigate to File -> Build Settings. Select Build and Run.
7. Wait for the building process to finish and enjoy. You have just created your first virtual reality app. 😃