Game Engines Lecture
CMSC498f/838 Presents
Introduction to Unity
Why Use a Game Engine?
Graphics
Physics
Audio
Networking
GUIs
Scripting
Much More!
Why Unity?
"the world’s leading platform for real-time content creation”
Beyond Games
Good At Making Games
(Who would have knew)
Unity Platforms
Unity Hub
Versioning
MAJOR.MINOR.BUGFIX
Tech Release vs Long Term Support
Long Term Support (LTS)
Tech Release
Unity Editor Interface
Toolbar
Controls
Status Bar
Controls
Project Window
Scene View and Overlays
“Your canvas”
Navigating Scene View
Game View
“What the user would see”
Hierarchy
Inspector Menu
Asset Store
Contains library of free and commercial assets that Unity and community members make
Package Manager
Package: a container that stores various features and assets
Package Manager: view which packages and feature sets are available for installation or already installed in your project
The Three Levels of Unity
Scene
GameObject
Component
Component
Component
GameObject
Component
Component
Component
Game Object
“ Anything which can exist in a Scene”
GameObject
The “building blocks” of your scene that compose things and objects
Components
Components
Scripts that modify the behavior and look of a GameObject
Custom Scripts
Materials
Materials describe the appearance of surface of your mesh
Mesh Renderer & Mesh Filter
https://docs.unity3d.com/Manual/class-MeshRenderer.html
https://docs.unity3d.com/Manual/class-MeshFilter.html
Colliders
Prefabs
https://docs.unity3d.com/Manual/Prefabs.html
“Blue Print”
Easily modify multiple gameobjects at once
Rigidbody
A Rigidbody provides a physics-based way to control the movement and position of a GameObject
User Interface
User Interface Continued
Raycast
https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
Invisible line that is sent out at a input position for a inputed distance to trigger a certain behavior
Particle System
https://docs.unity3d.com/Manual/ParticleSystems.html
Component to Render tiny meshes called particles to get a certain visual effect: rain, smoke, fire etc
Supported C# Code Editors
Visual Studio
Visual Studio Code
JetBrains Rider
Script Anatomy
Script Life Cycle
Important Unity Scripting Concepts
“Custom Components”
Input System
Learning Resources
Unity Blog:
Unity Forum:
Unity Answers:
Unity Discord
Unity Scripting API
Unity Manual
Come to the XR Lab (AVW 4176)!
Join XR Club
TerpLink
Discord
Website
VR Development Lecture
CMSC498f/838 Presents
With
What is Virtual Reality?
What is Virtual Reality
Inducing targeted behavior in an organism by using artificial sensory stimulation, while the organism has little or no awareness of the interference.
Virtual World Generator
Receives input from what the user is doing in the real world (ie head movement, controller input etc) and transfer that to the display as an output to maintain the virtual world
ARCore
ARCore
OpenXR
Oculus
WMR
Unity XR SDK
Display
Input
Environment
Faces
Raycast
Camera
Planes
Image Tracking
Object Tracking
Meshing
AR Foundation
XR Interaction Toolkit
Mixed and Augmented Reality Studio
AR
Applications
VR
Applications
Let’s Break it Down!
Provider Implementations
Enable communication between the headset, peripherals, and Unity
XR Plugin Framework
Core features that enable virtual and augmented reality within Unity
Developer Tools
Components and utilities that help you build your application
Creating a VR Project
Display Terminology
Resolution
A measure of the pixel dimensions of the displays
Refresh Rate
The rate at which the headsets show new images
Field of Vision
An angular measure of how much the displays cover your vision
Inside-Out vs Outside-In Tracking
Outside-In Tracking
Use stationary external devices to determine device position/orientation
Inside-Out Tracking
Use cameras and environmental features to determine device position/orientation
Standalone vs Tethered
Tethered
Headset is plugged into a computer which runs the application/games
(less portable, very powerful)
Standalone
Applications and games run directly from the headset with no PC required
(very portable, less powerful)
Virtual Reality Peripherals
Disclaimer about macOS Virtual-Reality Development
Useful Software for Quest Development
Oculus
Connect (tether) a Quest to your PC wired/wirelessly
Oculus Developer Hub
Manages/installs Quest apps and toggle developer features
Virtual Desktop
Alternative wireless VR streaming application, can function over internet
*
Unity Has a Built-In VR Template!
STOP
( DOESN’T WORK OUT OF THE BOX!)
Setting the Right Build Settings (for Standalone)
CTRL
SHIFT
B
Player Settings
Packages
Enable the OpenXR Plugin
Add Interaction Profiles
XR Device Simulator
A component which takes mouse and keyboard input from the user and uses it to drive simulated XR controllers and an XR head mounted display (HMD).
What is the XR Interaction Toolkit?
Enables locomotion systems within your project such as teleportation and “continuous”
Enables interactions between objects within your VR application
What’s this?
XR Origin
Camera Offset
VR Headset
Tracked Pose Driver
XR Controller
Left Controller
Right Controller
XR Interaction Toolkit
Oculus Controller
Index Controller
Vive Controller
Abstract Controller
Interactor
Interactable
Interactable
Interactable
XR Interaction Manager
Review
Interaction Manager
Gets new controller input data and updates interactors/interactables
Interactor
Interacts with interactables (selecting and activating)
Interactable
Objects that can be interacted with (e.g. flashlight, ball, gun, etc.)
Interaction States
Hover
The interactable is able to be selected (but isn’t yet)
Select
The interactable has been grabbed/selected by the user
Activate
The user has activated the interactable
(e.g. firing a gun)
Classify these!
Laser Pointer Selector
Hand Grabber
Beach Ball
Flashlight
Laser Gun
Classify these!
Laser Pointer Selector
INTERACTOR
Hand Grabber
INTERACTOR
Beach Ball
INTERACTABLE
Flashlight
INTERACTABLE
Laser Gun
INTERACTABLE
Types of Interactors
Direct
interacting with Interactables that are close
Ray Interactor
interacting with Interactables at a distance
Locomotion
Smooth/Snap
allows the user to smoothly/snap rotate and move their rig continuously
Grab
allows the user to move as if grabbing the whole world around them.
Teleportation
Instantly moving the XR Origin to the desired location on the user's request.