Virtual Reality with Unity
- 5.5 hours on-demand video
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Concepts and components of the Unity Engine and Editor and how to set up a project ready for VR
- Create a User Interface (UI) and game menu and build Interactions with C# scripting
- Learn VR elements and build a state machine through Unity's Animator
- Learn how to design an effective and solid virtual reality experience
- Achieve a stable framerate
- Master the tools and techniques you'll need for optimal VR performance.
- Learn the use of universal UX concept and some specific rules for VR design using Unity
- Use optimization techniques to achieve optimal VR performance
To understand how virtual reality can be used, let’s see some of the ways it has been used in the past.
• First, we will discuss how VR is used for training
• Then learn about the education and healthcare/medical uses
• Talk about construction, fitness, games, and more
In this video, we discuss the current Virtual Reality Landscape and the differences between the main devices used.
• First, we discuss the difference between standalone and tethered headsets
• We discuss standalone headsets
• Then we discuss tethered ones
In order to select objects and see things, pointers can be useful. In this video, we discuss how they can be added to controllers and how they can be rendered to a screen.
• First, we will discuss the pointer components
• We will then add pointer components
• Customize the pointer renderers
Since our player will always be holding the weapon. In this video, we see how to make that possible.
• Discuss the reasoning to automatically pick up the gun
• Use the VRTK_Object Auto Grab Component to spawn our weapon
• Then we will prevent the player from dropping it
While it is fine for a prototype, it’s important to have a model for our weapons. In this video, we see how to do just that.
• Use the Asset Store to find a weapon to use
• Replace the original model with our new one
• We adjust the bullet spawning to adjust to the new object
A still enemy is not very exciting. To provide even more feedback to our player, we will look at Unity’s Animator system and how to transition from different animation states.
• Explore Unity’s Animator window
• Discover the usage for Animator parameters and state transitions
• Play different animations depending on stimuli
Continuing with the thought of states, we implement the state machine design pattern for our enemy’s brains. With that we utilize Unity’s NavMesh system to move enemies to our player.
• Implement the state machine pattern utilizing enums and coroutines
• Utilize the NavMeshAgent to make the enemy come to the player
• Transition from one state to another depending on stimuli
To even the playing field, we let the enemy have a melee attack. Here, we discuss how to utilize Animation Events to have our animation and attack match each other.
• Have the enemy rotate to face the player
• Have the enemy stop when it is close to the player
• Implement a melee attack on the player with Animation Events
After finishing the level being built, we see how we can polish the scene using materials on the walls.
• Bring in materials and textures to the project
• Utilize the UV editor to apply materials to walls
• Modify object UVs to move and scale walls to fit effectively
Another useful aspect of level design is making use of triggers which will allow designers to craft gameplay elements when players enter a certain area. Here, we see how that can be done in VR.
• Add a box collider with the Is Trigger property
• Implement a trigger spawner behavior
• Detect collision with trigger and a VR headset
Having UI on the screen is one thing and having it do something is another. In this video, we discover how to update UI elements through code.
• Update the Handgun script to store references to UI objects
• Modify text at runtime through code
• Add a reloading mechanic to the game
Before we can optimize our game, we need to know some of the tools we can look at to learn where our game is slowing down. In this video, we look at both the Stats menu as well as the Profiler and see how they can be used.
• Explore the Stats menu and its uses
• Open the Profiler menu and explore how it is used
• Utilize the Hierarchy mode to see what is using the most CPU time
A tool that can be used to optimize a game is the concept of Texture atlases where you have multiple objects share the same texture. In this video, we see how it can be used.
• Discover what a Texture atlas is and what it is used for
• Install the Texture atlas creator for Unity
• Build a Texture atlas for scene props
Another option is having objects switch out with less detailed objects when they’re further from the camera. In Unity, this can be done with LOD Groups which we will use here.
• Open Blender and import prop models
• Utilize the Decimate modifier to simplify props
• Set up LOD Groups to blend between props
An even better way of saving computations is not even rendering something if it doesn’t need to be drawn. This can be done through the process of occlusion culling.
• Discuss culling and its usage
• Utilize Static properties for culling
• Visualize the occlusion culling in the scene
- Programmers or game developers who have a basic knowledge of Virtual Reality and want to explore what Unity has to offer will also find it useful. Knowledge of C# is required.
If want to know how to build the most vivid and realistic games using Unity, this is the perfect tutorial.
Virtual Reality is an exploding market and there is still a lot to discover about it. Unity 2019 is an intuitive multiplatform game engine that has become the industry standard for building Virtual Reality games, applications, and experiences for the new generation of consumer VR devices.
In this course, you will learn about the specifics of Virtual Reality development in Unity. You will learn how to intuitive VR user interfaces and integrate audio and video into your application to give a lasting impression. You will build practical solutions to some of the key issues facing Virtual Reality with helpful tips for making better VR experiences.
By the end of this course, you will have learned how to create a VR game using Unity 3D and implement some of the most common and useful interactions and game mechanics. You will also know how to think in VR and create a comfortable and effective user experience.
Please note that this course uses Unity 2019 and assumes prior working knowledge of Unity; however, those who have migrated to Unity 2020 will still benefit from the features and project deployment covered in this course. Please also note that knowledge of C# is also required for this course.
Programmers or game developers who have a basic knowledge of Virtual Reality and want to explore what Unity has to offer will also find it useful.
About the Author
John P. Doran is a passionate and seasoned technical game designer, software engineer, and author based in Peoria, Illinois. His passion for game development began at an early age. He later graduated from DigiPen Institute of Technology with a Bachelor of Science degree in Game Design.
For over a decade, John has gained extensive hands-on expertise in game development by working in various roles, ranging from game designer to lead UI programmer. He has worked in teams ranging from just himself to over 70 people in student, mod, and professional game projects (including working at LucasArts on Star Wars: 1313). Additionally, John has worked in game development education, teaching in Singapore, South Korea, and the United States. To date, he has authored over 15 books on game development.
John is currently an Instructor in Residence at Bradley University. In an earlier incarnation, he was an award-winning videographer.
- This course is for Unity Game developers who are beginning to work on Virtual Reality projects.