© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
C. CoutinhoUnity® Virtual Reality Development with VRTK4https://doi.org/10.1007/978-1-4842-7933-5_14

14. Movement Amplifier

Christopher Coutinho1  
(1)
GameWorks, Mumbai, Maharashtra, India
 

You’ve experienced several locomotion mechanics so far. In this chapter, we’ll set up a final locomotion mechanic provided by the VRTK, aptly called the Movement Amplifier. When setting up your Oculus Guardian or your HTC Vive Chaperone, you’re restricted by the room space you have available. Your movement within your VR World is limited by the room space you have in the real world. Every step you take forward in your available real-world room space is a step forward in your virtual world. Unless you have palatial room space, your physical movements in the real world will soon have you encountering your Guardian or Chaperone without having moved any significant distance in your VR world. The Movement Amplifier prefab provided by the VRTK helps overcome this setback. Using this prefab, you can amplify your movements within the virtual world, making it easier for you to cover further virtual distances despite having limited real-world room space. Thus, each step you take in the real world can be amplified to cover a much larger distance in your virtual world.

Movement Amplifier Setup

In the hierarchy, select the VRTK SETUP game object, and create a new empty child game object within it and rename it “VRTK MOVEMENT AMPLIFIER.” Then, select the Project tab and expand the “Packages” folder and locate the Tilia Locomotors Movement Amplifier Unity package. Expand the package until you locate its “Prefabs” folder.

With the “Prefabs” folder selected, drag and drop the Locomotors Movement Amplifier prefab in the right-hand pane onto the VRTK MOVEMENT AMPLIFIER game object in the hierarchy, making it a child. With the Locomotors Movement Amplifier game object selected in the hierarchy, ensure that its Movement Amplifier Facade component has been expanded in the Inspector.

Next, let’s set up its Source and Target properties in the “Tracking Settings” section. The Source property represents the source object whose movement needs to be observed. Expand the Camera Rigs, Tracked Alias game object in the hierarchy. Drag and drop the Headset Alias game object into the Source property parameter, as shown in Figure 14-1. The real-world movement of the source game object is amplified by the value of the Multiplier property and applied to your Play Area Alias (Target), thereby amplifying the Player‘s movement in the virtual world.

The Target property represents the game object against which the computed amplified movement is to be applied. As the Player’s movement in the VR World needs to be amplified, you’ll set this Target property value to the Play Area Alias. Drag and drop the Play Area Alias game object into the Target property parameter, as shown in Figure 14-1.

You now need to set up values for the properties in the “Movement Settings” section. You could leave the Ignored Radius property at its default value. Any source object movement occurring within the limits of the radius value specified here won’t be amplified. It’s important to note that you shouldn’t set this value to a very small number, as this could lead to amplification occurring while crouching, which is something you most likely wouldn’t want to have happen. At the same time, feel free to play around with this value and see what works best for you. For now, though, leave the Ignored Radius property value at its default of 0.25.

The final property that you need to set is the value for the Multiplier property. I found the default value of 2 to be too small to obtain any noticeable amplified movement. Set the value for the Multiplier property to 10. At this level, one step forward in the real world will amplify your movement tenfold in the VR World. This is all that’s required to get the Movement Amplifier working, see Figure 14-1.
Figure 14-1

Setting up the Locomotors Movement Amplifier game object

Testing Amplified Movement

It’s now time to test out this amplified movement mechanic. This mechanic only amplifies your actual physical movement in the real world. For amplified movement to work, you need to physically walk about in the confines of your Guardian or Chaperone. Amplified movement should not be used with other forms of locomotion like teleportation, arm swinging, or seamless locomotion, as a clash will occur. Ideally, each locomotion method should be used independently. You should toggle off all other forms of locomotion when using a specific locomotion mechanic to prevent different forms of locomotion from clashing with one another.

To test out this amplified movement locomotion method using your VR headset, hit the Play button in Unity’s editor to playtest your Demo scene. Take a couple of steps forward in your real-world room space, and you’ll see that you’ve moved a lot further in the virtual world than you have in the real world. Now walk backward a couple of steps, and you’ll find that you cover a lot more ground in the virtual world. Turn yourself around and move forward in the direction you’re facing, and you’ll see that you can cover a lot more distance in the virtual world. This is a great locomotion mechanic that you can use in several situations. It’s something you wouldn’t find readily available in other VR tool kits.

Summary

In this relatively short chapter, we looked at the final locomotion mechanic provided by the VRTK, which is something rarely found in other VR tool kits. You learned how to amplify player movement in the virtual world based on actual physical movement in a limited real-world room space. You learned about the various properties available as part of the Movement Amplifier Facade component and how you can tweak values for the Ignored Radius and Multiplier properties to fine-tune your amplified movement. Finally, we tested out this Amplified Movement mechanic.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.195.146