Book Image

Enhancing Virtual Reality Experiences with Unity 2022

By : Steven Antonio Christian
Book Image

Enhancing Virtual Reality Experiences with Unity 2022

By: Steven Antonio Christian

Overview of this book

Virtual reality (VR) has emerged as one of the most transformative mediums of the 21st century, finding applications in various industries, including gaming, entertainment, and education. Enhancing Virtual Reality Experiences with Unity 2022 takes you into the fascinating realm of VR, where creativity meets cutting-edge technology to bring tangible real-world applications to life. This immersive exploration not only equips you with the essential skills needed to craft captivating VR environments using Unity's powerful game engine but also offers a deeper understanding of the philosophy behind creating truly immersive experiences. Throughout the book, you’ll work with practical VR scene creation, interactive design, spatial audio, and C# programming and prepare to apply these skills to real-world projects spanning art galleries, interactive playgrounds, and beyond. To ensure your VR creations reach their full potential, the book also includes valuable tips on optimization, guaranteeing maximum immersion and impact for your VR adventures. By the end of this book, you’ll have a solid understanding of VR’s versatility and how you can leverage the Unity game engine to create groundbreaking projects.
Table of Contents (25 chapters)
1
Part 1: Philosophy and Basics of Understanding Virtual Reality
3
Part 2: Technical Skills for Building VR Experiences in Unity (Assets, GameObjects, Scripts, and Components)
12
Part 3: Projects: Putting Skills Together
21
Part 4: Final Touches

Creating a drawing system

In this section, we’ll be focusing on creating a drawing system that incorporates two core components: a canvas that can be drawn on and a marker that can be used for drawing. These two objects work together to create the drawing experience. Individually, they are just objects that you can interact with. You can expand on this system by modifying the canvas to cover a larger area, allowing you to draw on a larger surface instead of the predefined size we initially create.

To create a drawing canvas (Figure 12.7), go through the following steps:

  1. Create a new plane.
  2. Name it Whiteboard.
  3. Set the X position to 3.6, the Y position to 2.4, and the Z position to -0.4.
  4. Set the X rotation to 90, the Y rotation to 90, and the Z rotation to 90.
  5. Set the X scale to 0.3, leave the Y scale at 1, and set the Z scale to 0.3.
  6. Create a new C# script, name it WhiteboardController, and add it to the Whiteboard GO.
  7. Add the following namespace...