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

Popping balloons

Do you want to pop some balloons? "No", said no one ever! Let's add that feature and make a little game out of this. First, we'll make the balloons poppable with collision detection and an explosion. Then we'll add a ball to the scene that you can throw at a balloon to pop it. And after the ball is thrown, we'll fetch it back by resetting it to its original position after a short delay.

Making the balloons poppable

The Unity physics engine can detect when two objects collide. To do this, each object must have aCollider component attached. You can then have the collision trigger an event. We can also subscribe to that event to make something else happen, like play an explosion effect. This is set up on the balloon prefab. Let's do that now:

  1. In the ProjectPrefabs/ folder, open your Balloon prefab for editing by double-clicking it.
  2. SelectComponent |Physics |Sphere Collider.
  3. ...
lock icon The rest of the chapter is locked
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}