Reader small image

You're reading from  XR Development with Unity

Product typeBook
Published inNov 2023
Reading LevelBeginner
PublisherPackt
ISBN-139781805128120
Edition1st Edition
Languages
Tools
Right arrow
Authors (2):
Anna Braun
Anna Braun
author image
Anna Braun

Anna Braun is a Unity expert, who is specialized in creating XR applications. At Deutsche Telekom, Anna has developed XR prototypes in Unity. One prototype enabled warehouse workers to find commodities more easily through the use of special location data and Augmented Reality. At Fraunhofer, Anna specialized in Hand-Tracking and worked on a VR education platform. Her master's degree in Extended Reality has a special focus on Eye Tracking, Deep Learning, and Computer Graphics. She is a published author in the tech space and regularly speaks at conferences hosted by academia or non-profits like the Mozilla Foundation. Anna co-founded a company that offers XR consulting and development.
Read more about Anna Braun

Raffael Rizzo
Raffael Rizzo
author image
Raffael Rizzo

Raffael Rizzo is a XR developer and Unity expert. During his work at Deutsche Telekom, he consulted companies on the use of digital twins and implemented augmented reality wayfinding solutions. At Fraunhofer IGD, Raffael worked on a VR education platform. He developed a VR training program for a soccer academy to test the children's reaction times. For the same academy, Raffael created an application that uses computer vision and machine learning to automatically evaluate ball juggling. His master's degree in Extended Reality encompasses Rendering, Computer Vision, Machine Learning, and 3D Visualization. Raffael co-founded a company specializing in XR consulting and development.
Read more about Raffael Rizzo

View More author details
Right arrow

The Unity Editor and Scene Creation

In this chapter, we’ll lay the groundwork for your Unity journey. You’ll familiarize yourself with the Unity Editor, create a basic scene, and explore essential lighting aspects. We’ll cover installing Unity, navigating the Editor, working with GameObjects, importing assets, and experimenting with various lighting settings. By the end, you’ll have a solid foundation to delve deeper into Unity and create increasingly complex and captivating scenes.

We’ll cover the following topics as we proceed:

  • Setting up the Unity development environment
  • Getting to know the Unity Editor and its interface
  • Understanding GameObjects and components
  • Creating a basic scene in Unity and adding objects

Technical requirements

Before diving into the Unity Editor, it is important to ensure that your system meets the minimum requirements to run Unity. To successfully complete the exercises in this chapter, you will require a personal computer that has Unity 2021.3 LTS or a more recent version installed. To ensure your hardware meets the requirements, you can cross-check it on the Unity website (https://docs.unity3d.com/Manual/system-requirements.html).

Setting up the Unity development environment

First things first, let’s get Unity up and running on your development machine. Throughout this book, we’ll be harnessing the power of the Unity 3D game engine to create inspiring projects. Unity is an incredibly potent, cross-platform 3D development environment, complete with an intuitive and visually appealing editor.

If you have not yet installed Unity on your computer, we will guide you through the process. Following the installation, we’ll proceed to create our initial scene. Let’s begin the setup and exploration of Unity.

Installing the Unity Hub

Over the course of this book, the Unity Hub will become your trusty command center for managing different Unity projects, Unity Editor versions, and modules. To initiate the installation process of the Unity Hub, follow these steps:

  1. Head over to the official Unity website (https://unity3d.com/get-unity/download) and navigate to the latest version...

Getting to know the Unity Editor and its interface

If you’re new to Unity, the editor’s interface can be a bit overwhelming at first. But don’t worry—we’ll guide you through the Unity Editor and show you how to navigate its various menus and panels. Experienced users can also benefit from staying current with the latest best practices and techniques, as designing for VR presents unique challenges that may require a different approach than traditional game development.

Exploring the Unity interface

Upon launching a new Unity project, you’ll be greeted by the Unity Editor. This multifaceted workspace is composed of several distinct windows known as panels.

Figure 2.2 shows the window layout for the sample scene project we just created.

Figure 2.2 – The window layout for the sample scene project

Figure 2.2 – The window layout for the sample scene project

Figure 2.2 showcases a number of panels, namely: (1) Scene view, (2) Game view, (3) Hierarchy, (4) Inspector...

Understanding GameObjects and components

GameObjects and components are essential building blocks of Unity projects, allowing developers to create interactive and dynamic content. Now, we’ll provide a comprehensive overview of GameObjects and components and how they work together.

Understanding the default new scene

Unity empowers developers with the ability to create multiple scenes within the editor. This feature aids in managing complexity, enhancing performance, and fostering more modular and reusable game projects. To create a new default scene alongside our sample scene, access the menu at the uppermost section of the editor and choose File | New Scene | Standard (URP). Save it in your Scenes folder with a name of your choosing. After following these steps, you will be presented with a new Unity scene containing a Main Camera GameObject and a Directional Light GameObject. Both GameObjects are located in the Scene Hierarchy window and displayed in the Scene window...

Creating a basic scene in Unity and adding objects

In this section, we will walk you through constructing the scene depicted in Figure 2.4, which integrates elements such as primitives, materials, prefabs, lighting, and imported assets.

Figure 2.4 – The basic scene we are going to create

Figure 2.4 – The basic scene we are going to create

By engaging with this step-by-step tutorial, you will develop a strong knowledge of these core concepts while assembling an aesthetically striking scene. Our initial task involves crafting a table using primitive shapes.

Building a table with primitives

Primitives, as the name suggests, are simple geometric shapes that form the building blocks for more complex models in our scene. Imagine a chair taking shape as a cube forms the seat, two cylinders become the sturdy legs, and two more cylinders morph into supportive back legs. The backrest is crafted from a plane, its size and placement perfectly complementing the seat and legs.

A table for our scene can...

Summary

In this chapter, you constructed a fundamental scene, familiarized yourself with the Unity Editor, started learning how to import assets to your own project, and were introduced to the essential aspects of lighting.

You embarked on this journey by installing Unity through the Unity Hub and establishing a new project with a sample scene using URP. You then explored the Unity Editor’s basics, such as navigating its numerous windows and utilizing the scene editing options, including Grid and Snap. Moreover, you delved into GameObjects and their components, such as colliders.

Subsequently, you crafted your very own rudimentary scene, complete with a ground plane, a brick wall, and a table supporting a sphere. Along the way, you discovered the potency of materials, applied some, and designed your own advanced brick wall material using an imported image as a texture. You also examined the usefulness of prefabs and learned how to transform them into regular GameObjects...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
XR Development with Unity
Published in: Nov 2023Publisher: PacktISBN-13: 9781805128120
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.
undefined
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 £13.99/month. Cancel anytime

Authors (2)

author image
Anna Braun

Anna Braun is a Unity expert, who is specialized in creating XR applications. At Deutsche Telekom, Anna has developed XR prototypes in Unity. One prototype enabled warehouse workers to find commodities more easily through the use of special location data and Augmented Reality. At Fraunhofer, Anna specialized in Hand-Tracking and worked on a VR education platform. Her master's degree in Extended Reality has a special focus on Eye Tracking, Deep Learning, and Computer Graphics. She is a published author in the tech space and regularly speaks at conferences hosted by academia or non-profits like the Mozilla Foundation. Anna co-founded a company that offers XR consulting and development.
Read more about Anna Braun

author image
Raffael Rizzo

Raffael Rizzo is a XR developer and Unity expert. During his work at Deutsche Telekom, he consulted companies on the use of digital twins and implemented augmented reality wayfinding solutions. At Fraunhofer IGD, Raffael worked on a VR education platform. He developed a VR training program for a soccer academy to test the children's reaction times. For the same academy, Raffael created an application that uses computer vision and machine learning to automatically evaluate ball juggling. His master's degree in Extended Reality encompasses Rendering, Computer Vision, Machine Learning, and 3D Visualization. Raffael co-founded a company specializing in XR consulting and development.
Read more about Raffael Rizzo