VR tutorials - Unity

Immerse yourself in seated and room-scale VR, AR and MR with devices such as HTC VIVE and VIVE Pro, Oculus Rift, Microsoft HoloLens, Samsung Gear VR and Google Cardboard. Create merged and mixed reality installations in the Lab’s open-plan project space.

HTC VIVE Tutorials

HTC VIVE Tutorials

Steam VR setup Tutorial #1 - Player camera setup

Aims

This tutorial aims to get you started using Unity and HTC VIVE HDM (Head Mounted Display) Using Steam VR 2.2 plugin.

Please notice that this is the first of a series of tutorials focused on enabling the use of HTC VIVE devices, each tutorial will build on top of previous ones to get you from basic concepts to more functional and complex projects.

Prerequisites

  1. Download and install Unity 2018.2.21f1.
    More recent versions might also work, this tutorial was made using Unity 2018.2.21f1

  2. Create a Unity personal account. To use Unity you will have to create your own account as you will be prompted to login when you start running the software.

  3. Download and install Steam. Steam platform will install additional components needed to run the HTC VIVE on your computer. Click here to go to the Steam download page.

Getting started

Create a new Unity project, you might need to login first. Make sure you select a 3D template. Unity-SteamVR-Setup-4.PNG

After your new project opens, locate your mouse cursor on top of the "Hierarchy" panel and right-click to create a plane.

Unity-SteamVR-Setup-1.PNG

Unity-SteamVR-Setup-2.png

Now let's place the plane in the middle of the space. Select the plane and chose the Reset option inside the drop-down menu found on the right top corner of the transform component. This will reset all the transform values for the plane.

Unity-SteamVR-Setup-6.png

Now, let's make bigger so your player can have a bit more of space to interact. With your plane selected, look for the Transform component in the "Inspector" panel and change the scale to 10 on all three axes.

Unity-SteamVR-Setup-3.PNG

Now that we have a plane for our player to stand on, it is time to import the Steam VR Plugin from the asset store, this plugin will allow us to integrate and use both the VR Headset and the controllers. Click on the "Asset Store" tab and type "Steam VR" into the search box.

Unity-SteamVR-Setup-7.PNG

First, you will need to click the "Download" button, after downloading, the same button will turn into the "Import" button, click on it, you should see a window displaying all the contents of the package, just click Import.

Unity-SteamVR-Setup-8.PNG

After a moment, your package should be installed and you will be able to see the "SteamVR" folder in your Project panel.

Unity-SteamVR-Setup-9.PNG

We are almost ready to place our player in the scene, however, we need to delete the Main Camera (Included by default in our new project) as will conflict with our player's camera. Please notice that in most cases you will only need one camera inside of your project and having more than one usually requires extra settings for them to work properly. Please right-click over your Main Camera game object and select "delete".

Unity-SteamVR-Setup-15.png

Now we are ready to place our Player prefab. You can locate it either by looking for it inside of the SteamVR folder (see path below) or just typing "Player" into the search box found on top of the Project panel.

Unity-SteamVR-Setup-10.PNG

After dragging and dropping your player into your "Hierarchy" panel, hold the "alt" key and click on the little arrow next to the prefab name, this will unfold/display all the child objects contained inside the player game Object.

Unity-SteamVR-Setup-11.PNG

We are not going to review these elements in this tutorial, however, it is worth noticing that they include both controllers and the VR camera.

We are almost done, now you need to set up your HTC VIVE, run Steam VR and press play.

Unity-SteamVR-Setup-12.PNG

You will get a message asking you to generate the actions for the Steam VR Input, this file is the one that Unity uses to read the input from the controllers and the headset to generate actions in your project, for now, you just need to click "yes".

Unity-SteamVR-Setup-13.PNG

Next, you will see a new window listing the default action sets, just press the button that says "Save and generate".

Unity-SteamVR-Setup-14.PNG

Now you are ready to test it, press the Play button again, now you will be able to look inside of your new scene. You should be able to see both controllers following the movements of your hands and reacting to your interaction with the buttons. Unity-SteamVR-Setup-16.PNG

HTC VIVE Tutorials

Steam VR setup Tutorial #2 - Teleporting around your scene

Aims

This tutorial aims to show you how to enable the teleporting feature included in the Steam VR 2.2 plugin.

Please notice that this is part of a series of tutorials progressing from basic concepts to more functional and complex projects. In previous pages, we already explored how to set up the scene you are expected to use for this tutorial.

Prerequisites

  1. Setting up the Steam VR plugin.
    Steam VR setup tutorial# 1

Getting started

In the Steam VR setup tutorial #1, we downloaded the Steam VR plugin and placed the "Player" prefab on our scene, in this tutorial we are going to set up the teleporting feature also included in the plugin, we are also going to add a few teleporting spots to jump from one area to another. With our previous project open, please type "Teleporting" into the search box of the project panel.

Unity-SteamVR-Setup-17.PNG

Now just drag and drop the Teleport prefab into your "Hierarchy" panel, this will automatically enable the Teleport feature on both of your controllers, Before we test it, it is a good idea to change the default floor material to be able to see the "Bézier curve" more clearly. Please select your Assets folder in the Project panel and right-click to create a new material and name it "Blue". To keep things tidy, we recommend creating a "Materials" folder, then dragging your new material inside of it.

Unity-SteamVR-Setup-19.png

With your material selected, look at the inspector panel, you will see all the properties associated to your material, please click on the colour picker next to the Albedo slot.

Unity-SteamVR-Setup-20.PNG

You will see a colour window, please drag both white circles in order to get the desired shade of blue, to finish just close the colour window.

Unity-SteamVR-Setup-21.png

To apply your material, just drag it and drop it on top of the plane in the scene window.

Unity-SteamVR-Setup-22.png

Now we need to create a teleport area that will sit on top of our plane, the easiest way to achieve this is by duplicating our existing plane so right-click over the plane gameObject in the "Hierarchy" and select duplicate.

Unity-SteamVR-Setup-23.png

In order to keep things tidy, let's rename our new game object and place it underneath the "Teleport" prefab.

Unity-SteamVR-Setup-24.png

Now let's add the "Teleport Area" script to our new gameObject, please notice that if you are importing a custom mesh to use it as a Teleporting Area you have to make sure that it has a "Mesh Collider" component attached, in this case, as we duplicated a 3D object created directly in Unity, the Mesh collider is attached by default. With the "Teleporting Area" gameObject selected, click the "Add component" button in the "Inspector" panel and type "Teleport Area" and click over the "Teleport Area" script.

Unity-SteamVR-Setup-25.png

Finally, we need to move the "Teleporting Area" slightly up to place on top of the first plane, this is to avoid conflict between the colliders on both of the planes, With the "Teleport Area" gameObject selected, type "0.1" in the "Y" position slot of the transform component.

Unity-SteamVR-Setup-26.PNG

Now we are ready to test the Teleporting feature, Just hit the "Play" button. Once inside of your scene, please press the "Trackpad" button, you will see a "Bézier curve" projecting from the front of your controller to the ground. Try changing the angle of your controller to move the landing point, then, just let go the button and you will be teletransported to that location.

Unity-SteamVR-Setup-27.png

Unity-SteamVR-Setup-28.png

HTC VIVE Tutorials

Steam VR setup Tutorial #3 - Interactable object setup

Aims

This tutorial aims to get you started creating objects that you can interact with using your HTC VIVE controllers (Using Steam VR 2.2 plugin).

Please notice that this is part of a series of tutorials progressing from basic concepts to more functional and complex projects. In previous pages, we already explored how to set up the scene you are expected to use for this tutorial.

Prerequisites

  1. Setting up the Steam VR plugin.
    Steam VR setup tutorial# 1

  2. Setting up teleporting feature (Optional).
    Steam VR setup tutorial# 2

Getting started

In Steam VR setup tutorial #2 we added a blue material to a plane in order to make it easier for us to see the teleporting feature at work. In this tutorial, you are going to learn how to create two "throwable" objects but first, we are going to create a plinth to put the throwable objectS on so it is easier to test them.

To begin, right-click over the Hierarchy panel and select cube.

Unity-SteamVR-Setup-29.png

You should now see a cube intersecting the walking plane.

Unity-SteamVR-Setup-32.PNG

Now let's change the scale and the position to make it look like an actual plinth. With the cube selected look at the Transform component parameters shown on the Inspector, you will see that by default, your cube has the scale set to "1" and both Position and Rotation parameters should be set to "0" an all three axis.

Unity-SteamVR-Setup-31.PNG

Let's increase the "Y position" value up to 0.75 and the "Y scale" value to 1.5. It is also important to give meaningful names to our objects to keep our scene tidy. In order to change the name of a selected object just left-click inside the text field located on top of the Transform component and type your text.

Unity-SteamVR-Setup-35.png

Unity-SteamVR-Setup-30.PNG

Now our plinth should be taller and placed at the right height.

Unity-SteamVR-Setup-33.PNG

Now we are going to create our interactable objects. To create the first one, right-click over the hierarchy panel and select cube. With our new cube selected, let's change the Transform parameters to make it sit on top of our plinth. First change the scale down to 0.2 on all three axes then change the Position values as follows: x=.2, y=1.6 and z=0. Finally, let's put a name to it to keep things tidy, you can call it whatever you want, we suggest a meaningful name like "Magic cube".

Unity-SteamVR-Setup-34.PNG

We should see our "Magic cube" on top of our "Plinth".

Unity-SteamVR-Setup-36.PNG

Now, in order to make things look a bit more interesting, let's create and apply a new colour material to our interactable object, just right click on top of the project panel and select Create/Material, give it a meaningful name, like "Red" (or any other colour you might prefer).

Unity-SteamVR-Setup-37.png

Unity-SteamVR-Setup-38.png

Next, with your material selected, click on top of the "colour picker" box shown in the inspector. This will open a colour picker window where you can select the colour you that corresponds to the name of your material.

Unity-SteamVR-Setup-39.png

Now just drag and drop the material on top of your "Magic cube".

Unity-SteamVR-Setup-40.gif

Now we are ready to add the scripts (included in the Steam VR plugin) that are going to make your object interactable. With the "magic cube" selected, press the "Add component" button and type "throwable", this will filter the component list and will highlight the "Throwable" script. Now you just need to either press enter or click on top of it to add it to your object.

Unity-SteamVR-Setup-41.png

You will notice that instead of one, Unity actually added 4 different components.

Unity-SteamVR-Setup-42.png

Unity added those components automatically as your interactable object needs all three scripts and also a Rigidbody for the object to interact with the physics system. Press play and intersect the cube with the controller and pull and hold the trigger button.

Unity-SteamVR-Setup-46.png

Unity-SteamVR-Setup-53.gif

You might notice that both the controller and the virtual hand disappear once you start holding the cube in the air, if you let go the trigger button, you will notice that the cube falls and both the virtual hand and controller reappear.

Let's take a look at the "Interactable" script to understand what is happening, with the "Magic cube" selected, Take a look at the presets on the "Interactable" script found in the inspector. You will discover that the selection box for "Hide hand on attach" is checked.

Unity-SteamVR-Setup-50.png

Now let's uncheck the box and try again.

Unity-SteamVR-Setup-44.PNG

Unity-SteamVR-Setup-54.gif

Now the controller is displayed whilst pressing the trigger button, However, the hand seems to be off. Let's give another look at the properties for the "Interactable" script. You might notice that the "Hand follow transform" is also checked, this setting is making the hand model copy the transform values for the "Magic Cube", in order to change this, you just need to uncheck this box, then hit Play, and now you will see the hand properly graving the controller whilst picking up the object.

Unity-SteamVR-Setup-45.PNG

Unity-SteamVR-Setup-55.gif

HTC VIVE Tutorials

Installing Unity

In this tutorial, we are going to guide you through the Unity installation process, please make sure to follow the 4 steps:

1-Downloading and installing the Unity Hub
2-Creating an account
3-Installing Unity
4-Activating a free personal license

Before we begin, there are a few things you need to be aware of:



  1. Downloading and installing the Unity Hub.
    Before clicking on the link below, please make sure that once you get to the download page, you click on the button that says "Download Unity Hub" as shown in the picture below.

    InstallingUnity-2.png

    Go to the download page by clicking here

    Just follow the instructions, once you finish, continue with step 2.

  2. Creating an account.
    Once you finish installing the Unity Hub you will see a screen that gives you a chance to either login or to create an account, click on "Create account".

    Installing2022-1.jpg This will take you to an online form where you can add your personal details and create your account.

    Installing2022-2.jpg After finishing the registration process, you can go back to the Unity Hub and click "sign in", this will take you to another online form were you can log into your account.

    Installing2022-3.jpg Once you are logged in, you will get a popup window asking if you want to open the Unity HUB, Select "Open the Unity Hub", you will be sent back to the Unity Hub.

    Installing2022-4.jpg

  3. Installing Unity.
    Click on the "Installs" tab and then click on the "Install Editor" button.

    Installing2022-5-a.jpg

    We recommend installing Unity 2019.4, alternatively, you can choose Unity 2020, just be aware that your interface will look slightly different from the one shown during the workshop.

    Installing2022-6-a.jpg You will then see another screen with a list of modules you can add to the instalation, you won't need any of those for now so just Hit Install.

    Installing2022-7-a.jpg

  4. Activating a free personal license.
    Once you finish the installation, click on the Projects tab, you will see a message stating that you don't have a valid license, we are going to activate your license now. Click on the gear icon, this will open a new window.

    Installing2022-8-a.jpg

    Select the Licenses tab and then hit Add

    Installing2022-9-a.jpg

    Click on the "Get a free personal license" option.

    Installing2022-10-a.jpg

    Read and agree to the terms

    Installing2022-11-a.jpg

    Close the window.

    Installing2022-12-a.jpg

    And that is it. Now you are all set and the software is ready for you to create your first project.

Oculus Quest Tutorials

Oculus Quest Tutorials

OculusQuest - Setting up development enviroment in Unity

Supported Unity versions

Currently, there are 3 supported Unity versions:

We strongly recommend using Unity 2019.2 as this is the version we are currently providing support for.

Getting the Oculus Integration package

Unity already provides built-in support for the Oculus Quest, however, we recommend downloading the Unity Integration Package (Version 14.0 on March-2020) as it will provide additional resources like an interface for controlling VR camera behaviour, a first-person control prefab and scripts for object grab and haptics. The easiest way to get the Oculus Integration package is by accessing the Asset Store tab in Unity and typing “Oculus Integration” on the search box.

OculusQuest-UnityInt-WEB-1.png
OculusQuest-UnityInt-WEB-2.png

Once you have found the right asset, click on it, you will be taken to the download page, Hit download, you might have to accept the Asset Store terms of service, once it finishes downloading, you will see an install button, click on it.

OculusQuest-UnityInt-WEB-3.png OculusQuest-UnityInt-WEB-4.png OculusQuest-UnityInt-WEB-5.png

After a few seconds, you should see a new window displaying all the contents of the package.

OculusQuest-UnityInt-WEB-6.png

Hit Import, there is a good chance that you will get a message asking you to upgrade to a new version, this because Oculus keeps updating the package outside the Unity store, just click yes.

OculusQuest-UnityInt-WEB-8.png

You will then be asked if you want to restart the Unity editor, hit Restart.

OculusQuest-UnityInt-WEB-9.png

You might also get another message asking you if you want to upgrade the spatializer plugin, hit Upgrade and then hit Restart.

OculusQuest-UnityInt-WEB-10.png

OculusQuest-UnityInt-WEB-11.png

Once you reopen your project, you should see a new Oculus folder inside of your Assets folder.

OculusQuest-UnityInt-WEB-7.png

After successfully installing the Oculus integration package, you will have access to a lot of developing resources, we suggest opening and testing the new sample scenes inside the Oculus folder, just follow the highlighted path.

OculusQuest-UnityInt-WEB-12.png

Oculus Quest Tutorials

Getting started with Oculus in Unity

Go to website

Mobile VR

Mobile VR

Mobile VR - Getting Started Guide

Having access to a VR device is easier than you think, you just need a mobile phone and in some cases, an affordable Mobile headset. These are some options we recommend, whatever option you choose, just make sure that they are able to fit your phone. You won't need extra controllers or fancy additional gadgets.

Inspiration

Below you will find a list of online resources that you can test for inspiration, we hope you enjoy them and hopefully, they will help you get started.

Google Expeditions App

This google app, available for both Android and IOS devices, allows you to access lots of content for both Virtual Reality and Augmented Reality. You might need a Mobile VR Headset to experience the VR content. click here to visit

Sketchfab Website

This is an online community for 3D model creators, all models have an option to view in VR found in the bottom right corner of each 3D model window. click here to visit

WEB VR Experiments - Google

This is a very cool website where you can experience different types of content using your mobile phone click here to visit

Youtube VR

This is the official youtube channel for VR content, you will find lots of immersive videos from creators around the world. You might have to install the youtube app on your mobile device. click here to visit

Software


There are many different tools you can use to create VR content, some will allow you to create simple content fairly easily and some will help allow you to create very robust interactive applications but will require more effort, here we provide a list of different tools along with a description.
A-Frame

This is a fun to use online tool that will require you to do some basic coding, they have very cool and ready to test projects on their webpage. This is a list of useful links if you want to start exploring it.

A-FRAME website
Youtube tutorial list

Unity 3D

This is a very popular opensource Game Engine, this is the kind of tool professional VR Developers use to create content, it will require more effort to learn how to use it but it will allow you to take things to the next level.It is also worth mentioning that we do have lots of experience supporting students developing projects in this platform so feel free to contact us if you need support, bellow you will find a list of useful links to get you started.

Setting Up Unity
Official Tutorials for beginners intro
Official Tutorials for beginners

Buying a Mobile VR Headset

Amazon US
ETVR 3D VR Headset

Amazon UK
KINGA VR Glasses

Aliexpress
Box Movie 3D Goggles

We are here to help

If you need technical support for your Mobile VR Project, please contact our VR technician Alejandro Escobar, just send an email to j.escobarramirez@arts.ac.uk

Mobile VR

Mobile VR -Setting Up Unity

Setting Up Unity

  1. Download and install Unity 2019.2.0f1.
    Previous versions might also work, however, this tutorial was made using Unity 2019.2.0f1 (please read the following instructions before installing Unity).

  2. Create a Unity personal account. To use Unity you will have to create your own account as you will be prompted to login when you start running the software.

Android and/or IOS build support

To compile mobile applications on your computer, you will need to make sure to download the Android and/or the IOS build support. Please be aware that both Windows and IOS computers might allow you to compile Android apps, however, IOS apps require you to use a MAC computer running Xcode as IOS build is not supported on Windows PCs.

Please keep in mind that in most cases you won't need both Android and IOS build support, think about the kind of device are you planning to use to test/show your project. We found that in most cases, students use just one device. Also, keep in mind that building an app for two different platforms might add significant complexity to your project as you might need to test/debug your app on both platforms.



AR-vuforia-setup1-f.png

When installing either of these SDKs you might find your self facing three different scenarios, first, you might be installing 2019.2.0.f1 for the first time, second, you might have Unity already installed on your computer and you are missing the SDKs, finally, you might have a previous version installed on your computer, it does not have the SDK installed and, for some reason, you can't install Unity 2019.2.0f1, all these situations require different procedures that will be explained in the following lines.

Installing Unity 2019.2.0f1 for the first time

First, we recommend installing the Unity HUB as it will make your life a lot easier when installing and using Unity 2019.2.0f1. After installing the HUB, you just need to go to visit the Unity Download Archive, find the Unity 2019.2.0f1 version and click on the button that says "Unity HUB" this will automatically open the HUB and then run the installation wizard.

AR-vuforia-setup1-c-1.png

AR-vuforia-setup1-c-2.png

You will see a list of all the available Unity components, you just need to make sure that the Android and/or the IOS build support is selected before continuing with the installation. AR-vuforia-setup1-b.png

Do notice that the Android build support includes the Software Development Kit (SDK), the Native Development Kit (NDK) and the Java Development Kit (OpenJDK). Just make sure all of them are selected before continuing. After this, you just need to follow the final steps of the installation process.

Interaction Toolkit Essentials

Interaction Toolkit Essentials

Getting Started

Go to video

Interaction Toolkit Essentials

Interaction Toolkit examples

Overview video:(https://www.youtube.com/watch?v=MIoGBoC1txM&ab_channel=MicrosoftDeveloper)

Esamples page (https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples)

Interaction Toolkit Essentials

Interaction Tookit Basic Interaction

Go to video

Interaction Toolkit Essentials

Interaction Toolkit custom hands

Go to video

Interaction Toolkit Essentials

Doors, Drawers and Levers

go to video

Oculus Integration - Hand Tracking

Go to video