Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 2020 Virtual Reality Projects

You're reading from   Unity 2020 Virtual Reality Projects Learn VR development by building immersive applications and games with Unity 2019.4 and later versions

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781839217333
Length 592 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jonathan Linowes Jonathan Linowes
Author Profile Icon Jonathan Linowes
Jonathan Linowes
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Virtually Everything for Everyone 2. Understanding Unity, Content, and Scale FREE CHAPTER 3. Setting Up Your Project for VR 4. Using Gaze-Based Control 5. Interacting with Your Hands 6. Canvasing the World Space UI 7. Teleporting, Locomotion, and Comfort 8. Lighting, Rendering, Realism 9. Playing with Physics and Fire 10. Exploring Interactive Spaces 11. Using All 360 Degrees 12. Animation and VR Storytelling 13. Optimizing for Performance and Comfort 14. Other Books You May Enjoy

Installing Unity

To get started, you first need to install Unity on your development machine. All the projects in this book will be built using the Unity 3D game engine. Unity is a powerful, cross-platform 3D development environment with a user-friendly editor.

If you don't have Unity installed on your computer yet, we'll do that now! The full-featured Personal Edition is free and runs on both Windows and Mac (for details, see https://store.unity.com/#plans-individual). This book is written with Unity 2019.4 LTS and Unity 2020.x in mind.

Development system requirements

There are a few prerequisites that we need before we get started. You should have a Mac or Windows PC to develop on with enough resources to install and run Unity (a Linux version of Unity is also in the works). Details of the current system requirements for Unity can be found on its website (https://unity3d.com/unity/system-requirements), including the supported operating system versions, the graphics card, or built-in GPU, sufficient disk space, and necessary RAM.

For VR development, we recommend that you have a physical device that you are targeting for the build applications, compatible with the Software Development Kit (SDK) that you are using with Unity. That may be an Android mobile VR, such as Oculus Quest, or a Windows-based HMD, such as Oculus Rift, HTC Vive, Windows IMR (from Acer, HP, and so on), or the other VR device supported by Unity.

Installing Unity Hub

Unity Hub is a convenient desktop application for managing all your Unity projects and installed versions, and is a portal to Unity's own plethora of learning content. It is not uncommon to create a project using one version of Unity, and then at a later date start another project with a newer version of Unity. I recommend using Unity Hub for managing your Unity installs and projects (https://docs.unity3d.com/Manual/GettingStartedUnityHub.html).

For existing projects, hold back on updating Unity to a newer version until you've scheduled time to address possible compatibility issues that might be introduced with the upgrade. This is especially recommended with projects that are nearing release. Unity Hub is a convenient tool for managing your Unity projects and associated installed versions.

If you don't have Unity Hub installed on your development machine, do it now by going through the following steps:

  1. Browse to the Unity Store Unity Personal download page at https://store.unity.com/download.
  2. Download and install Unity Hub.
  3. Sign in to your Unity account or Create one if you do not have an account.

Now we can install Unity itself.

Installing the Unity Editor

The next step is installing the Unity Editor itself, and at the same time, the modules that are needed for you to build your target platforms. To install Unity, go through the following steps:

  1. Within Unity Hub, choose Installs in the left-hand menu tabs.
  2. Select the ADD button to open the Add Unity Version dialog box, and choose the current version of Unity, 2019 or later.
  3. Select Next to select the optional modules that you also want to install.
  4. If you're targeting Android devices, check the Android Build Support module, as well as the corresponding tools (you may need to unfold the list with the arrow icon), as shown in the following screenshot.
  5. Then select NEXT.
  1. If prompted, accept any additional license terms and the download will begin:

Now we're ready to create our first project.

Creating a new Unity project

Let's create a new Unity project named VR_is_Awesome, or whatever you'd like:

  1. In Unity Hub, choose Projects in the left-hand menu tabs.
  2. Select the NEW button (in the top-right) to start a new project (note that the NEW button includes a dropdown list for selecting an installed Unity version other than your default).
  3. In the Create New Project dialog box, you will be prompted to choose a Template. For the projects in this book, we will use the Universal Render Pipeline. Select Universal Render Pipeline.
  1. Enter a project name, such as VR_is_awesome. You can also select its location in your filesystem.
  2. Select CREATE to create a new empty project and open the Unity Editor on your desktop.
When creating a new Unity project, the Unity Hub offers a choice of templates to use as your starting point. The projects in this book will focus on the Universal Render Pipeline template. We will discuss render pipelines and related topics in Chapter 8, Lighting, Rendering, Realism.

A Create New Project dialog box is shown in the following screenshot:

Unity Hub gives you the option to choose a template when creating a new Unity project. The projects in this book will use the Universal Render Pipeline (formerly called the Lightweight Render Pipeline). If you are aiming for high-end graphics quality, you may decide to use the High-Definition Render Pipeline (HDRP) in your own projects instead.

In addition to the tools mentioned here, I highly recommend that you use a version control manager with each of your projects. Unity has built-in support for Perforce and Plastic SCM, as well as its own Collaborate service (https://unity.com/unity/features/collaborate). These team-oriented solutions are best suited to larger projects with multiple developers and other contributors. Personally, I'm a big fan of Git (and GitHub or BitBucket) for personal and small team projects. Even on solo projects, version control is a sane way to backup your work, with the ability to revert changes, recover from mistakes, and explore experimental branches of your project. Setup requires some familiarity with the version control platform that you choose, and is outside the scope of this book.

Installing additional packages and assets

Once you create and open a specific Unity project, there may be more packages and assets that you want or need to install. Unity provides several avenues for extending its features, platform support, editor tools, and runtime assets:

  • Package Manager: Use the Unity Package Manager (in Unity's top menu., go to Window | Package Manager) to view which packages are available for installation or are already installed in your Project (https://docs.unity3d.com/Manual/upm-ui.html).
  • Import Unity Package: You can import asset package files (filename extension .unitypackage) from the menu Assets | Import Package—for example, packages can be exported from another project and shared via Assets | Export Package.
  • Import Asset: You can import individual assets that are created with another app or downloaded from the web with Assets | Import New Asset, or simply drag and drop a file into the Project window in Unity.

We'll use all of these mechanisms at one time or another later in this chapter and throughout this book.

The Unity Asset Store, available through your web browser, is home to a growing library of free and commercial assets created both by Unity Technologies and members of the community. Learn more at https://unity3d.com/quick-guide-to-unity-asset-store. Assets you may have purchased (or got for free) on the store can be installed using the Open In Unity button on the web page, and also as a package listed in the Package Manager.

With a new project, it's always a good idea to open thePackage Managerand review what's already installed in your project, so let's do that now:

  1. Select Window | Package Manager.
  2. By default, the filter is set to In Project.
  3. You may notice that from time to time, newer updates to your packages will become available. With appropriate caution, you should update. Especially with point releases, these updates should only be bug fixes rather than potentially breaking features.
  4. To add a package, you need to find uninstalled packages. Change the filter dropdown to All Packages to see all packages, including those not yet installed in your project.

The following image shows a Package Manager window where several packages have updates available:

Now that you have Unity installed on your development machine, let's explore how to use the Unity Editor.

You have been reading a chapter from
Unity 2020 Virtual Reality Projects - Third Edition
Published in: Jul 2020
Publisher: Packt
ISBN-13: 9781839217333
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime