Lab 1 - VR Personal Project Basics

Tutorial

·

Beginner

·

+10XP

·

120 mins

·

Unity Technologies

Lab 1 - VR Personal Project Basics

In this first lab, you'll fill out a design document to lay out your concept, and then set up a basic VR scene using simple primitive shapes.

This lab will draw on skills learned in the following lessons:

This lab is part of the Create with VR course.

Languages available:

Overview Video

1. Fill out your design document

Before you get working on your project, you need a plan for what you’re actually going to create. The best way to do that is with a Design Document.

1. Get a blank copy of the VR Project design document:

2. Fill out Section 1 (App Info) of the document:

  • Give your app a tentative title.
  • Place a checkmark (using copy and paste) next to the one or two categories that best describe your app.

3. Fill out Section 2 (Pitch) of the document:

  • Describe the goal of the app.
  • Describe why it will be especially effective in VR.
  • Describe what users will do during the app, at a high level.
  • Specify whether your app will target devices with 3 or 6 degrees of freedom.

4. Fill out Section 3 (Basics) of the document:

  • Describe where the app will take place and how users will get around the environment.
  • List the types of GameObjects users will be able to grab and any socket interactors you will likely use.

You should now have the first three sections of your design document complete, providing enough direction to complete the rest of this lab.

2. Open and run a new VR project

Just like you did at the start of the VR Room project, the first thing you have to do for your personal projects is create a new Unity project configured for VR.

1. Create a new Unity project for your personal project:

  • Follow the instructions in the VR Project Setup tutorial.
  • Move the extracted folder to the same directory as your VR Room project.
  • Instead of naming your project “VR Room - [Your Name]” - name it “VR Personal Project - [Your Name]”.

2. Import the VR Course Library into your project:

3. Configure your project to run on your specific device:

4. Make sure you’re ready to start developing your personal project:

  • Rename and open the starter scene.
  • Make sure you can successfully run your project on your VR device or with the XR Device Simulator GameObject.

5. If you don’t want the Challenges in your project:

  • In the Project window, right-click the Challenges folder and select Delete.

You should now have a new project open to a starter scene and be able to test it in VR or with the XR Device Simulator GameObject.

3. Set up the basic scene with primitives

Rather than using assets from the course library, you can develop this basic scene using primitives and simple colored materials:

1. Create the ground:

  • In the Hierarchy window, select the Plane GameObject.
  • Reset the Plane GameObject’sTransform component’s Position property values to X = 0, Y = 0, and Z = 0 in the Inspector window.
  • Rename it “Ground”.

2. Keep your materials organized:

  • Create a new “Materials” folder inside the Assets directory.

3. Create a material for the Ground GameObject:

  • Right-click in the Materials folder and select Create > Material.
  • Rename the new material “Ground”.
  • Edit the Base Map color in the Inspector window.
  • Drag the material onto your Ground GameObject.

4. Block out the rest of your basic scene:

  • Continue creating and scaling additional primitive GameObjects (cubes, spheres, planes, capsules, etc.) and applying simple colored materials.
  • Don’t create grabbable GameObjects yet - only critical environmental things like a room, a table, etc.

Note: If you have GameObjects that will be reused throughout the scene, you should create a “Prefabs” folder and drag those GameObjects into it to make them prefabs.

You should now have your basic scene blocked out with primitives at an appropriate scale.

4. Set up basic locomotion

Now that you have the basic scene blocked out, you need some way of getting around it.

1. Allow the user to move around the scene:

  • Follow the instructions in the VR Locomotion tutorial to set up Teleportation Areas.
  • It might be helpful to temporarily make your entire Ground GameObject a Teleportation Area for testing and development purposes.
  • Alternatively, it might be helpful to use continuous movement for testing and development purposes.

2. Allow the user to teleport to important locations in the scene:

  • Follow the instructions in the VR Locomotion tutorial to set up Teleportation Anchors.
  • Instead of using the mats like you did in your room, create 1 x 0.1 x 1 cubes named “Teleportation Anchor”.
  • Remember to set the Match Orientation property to match the anchor’s forward direction.

You should now be able to move around your basic scene.

5. Set up basic grabbable GameObjects

The last thing you’ll do is create any grabbable GameObject prefabs you expect the user to interact with.

1. To make more complex GameObjects with primitives:

  • Create an empty GameObject.
  • Rename the GameObject.
  • Create primitive child GameObjects to represent the mesh of the form of the GameObject.

2. To make your GameObjects grabbable:

  • Follow the instructions in the Grabbable Objects tutorial.
  • Add components on the empty parent GameObject, not the primitive child GameObjects.

3. To add sockets to your scene:

4. To make your interactable GameObjects into prefabs:

  • Drag each new interactable GameObject into the Prefabs folder.

You should now have basic functioning prefabs for the main grabbable GameObjects in your scene.

6. Organize your Hierarchy

Before your Hierarchy window gets too crowded, you should take a moment to re-organize it.

1. To make organizer GameObjects in your Hierarchy window:

  • In the Hierarchy window, create new empty GameObjects named “XRI,” “LIGHTING”, “STATIC,” and “DYNAMIC,”
  • Reset all of their Transform component’s Position property values to X = 0, Y = 0, and Z = 0.

2. To organize your GameObjects into categories:

  • Drag GameObjects from your Hierarchy window either onto the organizer GameObjects (to make child GameObjects) or underneath the organizer GameObjects (to use the organizer GameObjects as headers)

Your Hierarchy window should now be organized by category.

7. Recap

New functionality:

  • VR project set up
  • Scene blocked out with primitives
  • Locomotion around the scene
  • Grabbable GameObjects
  • Socket interactors

New concepts and skills:

  • Applying VR basics, such as locomotion and grabbable GameObjects in your own VR app.

Next lab:

  • Implement core functionality and interactions.
  • Implement core functionality and interactions.

Complete this tutorial