Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Unity 2020 Virtual Reality Projects - Third Edition

You're reading from  Unity 2020 Virtual Reality Projects - Third Edition

Product type Book
Published in Jul 2020
Publisher Packt
ISBN-13 9781839217333
Pages 592 pages
Edition 3rd Edition
Languages
Author (1):
Jonathan Linowes Jonathan Linowes
Profile icon Jonathan Linowes

Table of Contents (15) Chapters

Preface 1. Virtually Everything for Everyone 2. Understanding Unity, Content, and Scale 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

Using prefabs

Unity prefabs (short for prefabricated object) allow you to create, store, and modify GameObjects as reusable assets together with all its components, property values, and child GameObjects. Prefabs are easily created by dragging an object from the scene Hierarchy window into the Project window, or they may be imported as part of a Unity asset package. You can read more about prefabs in the Unity Manual at https://docs.unity3d.com/Manual/Prefabs.html.

Let's see how this works by creating a simple reusable model built from simple geometric elements.

Creating and instantiating a prefab

We're going to create a reusable character prefab named BobHead. First, let's build the little guy from a few primitive 3D objects, as follows:

  1. In the Hierarchy, create an empty GameObject named BobHead (by clicking on +| Create Empty; name it BobHead).
  2. Set its position to something like Position (3, 0.75, 1.25).
  3. ...
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 $15.99/month. Cancel anytime}