Reader small image

You're reading from  Unity Virtual Reality Projects

Product typeBook
Published inSep 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783988556
Edition1st Edition
Languages
Right arrow
Author (1)
Jonathan Linowes
Jonathan Linowes
author image
Jonathan Linowes

Jonathan Linowes is a VR/AR enthusiast, Unity, and full stack developer, entrepreneur, certified Unity instructor, and the owner of Parkerhill XR Studio, an immersive media, applications, and game developer. Jonathan has a bachelor of fine arts degree from Syracuse University, a master of science degree from the MIT Media Lab, and has held technical leadership positions at Autodesk and other companies. He has authored multiple books on VR and AR published by Packt Publishing.
Read more about Jonathan Linowes

Right arrow

A human trampoline


Now, you'll get to jump on the trampoline yourself.

Feature: When a first-person character hits a trampoline, it bounces up, diminished by gravity.

Like a brick

One approach towards implementing this feature could be to treat the MeMyselfEye first-person character like Brick and give it a Rigidbody and a Capsule Collider so that it can respond using physics. We'll try this first just to see whether it works. For this to work, we need to disable its Character Controller component and start at the brick's position above the trampoline so that we can just drop, as follows:

  1. Navigate to File | Save Scene As and name it HumanTrampoline.

  2. Delete Brick in Hierarchy; we won't need it.

  3. With MeMyselfEye selected in Hierarchy, set Position to (0, 5, 0).

  4. Navigate to Add Component | Physics | Rigidbody.

  5. Navigate to Add Component | Physics | Capsule Collider and set its Height to 2.

  6. In the Rigidbody panel, under Constraints, check off the Freeze Rotation X, Y, Z checkboxes so that we don't get...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity Virtual Reality Projects
Published in: Sep 2015Publisher: PacktISBN-13: 9781783988556

Author (1)

author image
Jonathan Linowes

Jonathan Linowes is a VR/AR enthusiast, Unity, and full stack developer, entrepreneur, certified Unity instructor, and the owner of Parkerhill XR Studio, an immersive media, applications, and game developer. Jonathan has a bachelor of fine arts degree from Syracuse University, a master of science degree from the MIT Media Lab, and has held technical leadership positions at Autodesk and other companies. He has authored multiple books on VR and AR published by Packt Publishing.
Read more about Jonathan Linowes