Having a hard time walking in VR?
Follow our guide to do that.
How Do You Walk in VR?
Current VR technology relies on handheld devices that allow users to move through a virtual world using their hands. They can only travel within a space defined by physical reality.
If the user wants to move forward, they need to press the joystick button.
What is VR Locomotion?
Locomotion means moving from one location to another in physical space; it comes from the Latin word for “to go” and “motion.”
First Person View (FPV) locomotion is the technology used to enable the movement of an avatar’s head through the entire virtual world by using only a small real-world environment. It is one of the key elements of a good VR/AR game.
Why is VR Locomotion Important?
Since 2015, when the hardware and tech were able to allow for more experimentation and the creation of VR worlds, the most important thing has been immersion.
Even though VR replaces your real world with digitally created environments, there are glitches in the digital world that disrupt your sense of touch, sight, hearing, taste, smell, and balance.
According to Oculus for developers’ guidelines, you should consider several factors when designing and building an immersive VR experience:
- Acceleration – fast, unexpected motions cause discomfort or even nausea. Attention should be paid to body and head motion.
- To achieve the best VR experience for humans, Oculus suggests speeds of human locomotion between 1.4 meters per second (m/s) and 3 m/s (3 m/s).
- With motion controllers, the player selects the range of space (Guardian Mode) for their character. Game designers and programmers need to know that backward movement and lateral movements are uncommon.
- User Control — Let the user control the movement as much as possible. This is extremely important for gameplay and enjoyment.
- Visual Quality — visual quality is crucial too. There’s a fine line between quality and performance; rapid movement such as nodding may cause the immersion to be broken.
VR Locomotion Techniques
There are several ways to move the user through an environment. Each way has its own advantages and disadvantages.
There are several different types of locomotion techniques that have been tried and refined for quite some time, and they’re classified into these categories:
This approach uses only the players’ physical movement on real-world space, so the applications must be designed to take advantage of this constraint. For instance, Beat Saber is an excellent game that takes full advantage of this constraint.
For now, these additional hardware components aren’t included with the major headsets. However, they could be added later.
For generations, gamers used a trackpad or thumb stick to control their characters, and now they’re trying to use the same methods for VR apps.
However, the perception of moving in a virtual environment while remaining stationary in the physical one could lead to motion sickness, or more precisely, something called “vestibular mismatch.”
To enable locomoting in VR, some additional techniques had to be implemented, including limiting the field of view while walking, which reduces the number of details seen by the player and thus lowers the chances of triggering vestibular mismatch.
Teleporting is the only non-continuous locomotor technique, which means that when players teleport, they are instantly positioned at their destination without any intermediate steps. Players can choose where they want to go and even decide if they want to face forward or backward during teleportation.
Like the controller-base technique, a raw implementation has its own set of disadvantages, suddenly changing the players’ positions without any context leaves them completely disoriented, so, there are several variations for this technique.
When playing this game, when you select the target point, the screen fades out, you’re transported into the virtual world, and then the screen returns. It almost seems like you blinked and voila! You’ve arrived at your destination.
Dash locomotion is by far one of the most used, but if you use it too often, it may interrupt the player’s experience. For that reason, there is the “dash” variation which rushes the player to their destination without stopping.
To avoid triggering vertigo, we need to be careful when using raw data. We add some animations that act as anchors for the player, much as a car dashboard might.
How Do You Walk in VR?
1) Enable Developer Mode on your Oculus Headset
Follow the instructions provided by Oculus.
2) Unity Android Build Support
Make sure that Unity is configured correctly for Android builds.
3) Create a new Unity Project
From the Unity Hub, create a new 3D project.
After creating the app, switch to the Android Platform by selecting File > Build settings.
4) Install Unity Package Manager Packages
Install the following packages from the Package Manager.
- XR Plugin Management
- Oculus XR Plugin
Once you’ve downloaded the required packages, open the Project Settings dialog box by clicking File > Project Settings…
Install XR Interaction Toolkit
You can’t use this feature yet because it’s not part of the final release. To get access to it, you need to enable the “show preview packages” option.
When installing Unity, you’ll be prompted to switch to the new user interface. Accept that.
After installing this package (the XR Interaction ToolKit), install the Default Input Actions from there.
If you want to use the Oculus Rift headset, you need to create an XR rig first. You can do so by selecting “Room-scale XR Rig” from the Action-based dropdown list under the Game Objects tab.
With just a few lines of code, we’ve already got room-scale-based locomotions!
Locomotion System Setup
The XR Interactions Toolkit comes with solutions to control locomotion using controllers and teleportation out of the box.
To add the following components to the GameObject called “XR Rig”, add these components:
- Input Action Manager
- Character Controller
- Character Controller Driver
- Locomotion System
- Teleportation Provider
You can now use the new Input Action Manager to create actions for any input type. To do so, go to Settings > Input Actions > New Input Action.
And from the folder Assets > Samples > XR Interaction Toolkit > 0.10.0-preview.7 > Default Input Actions, drag the XRI Default Continuous Move and XRI Default Snap Turn assets into the XR Rig gameObject.
XR Controllers Setup
The controllers GameObjects are children of the XR Rig, and can be found at XR Rig > Camera Offset > LeftHand / RightHand Controller in the hierarchy window.
Delete the current XRController component on each of the Hand Controllers GameObject, then drag the XRDefaultLeftRightComponent from the folder Assets\Samples\XRInteractionToolkit\0.10.0-Preview.7\DefaultInputActions to their respective game object.
We’ve successfully built our first locomotion system using the XR Interaction Tool Kit. Now let’s see how we can make it work!
If you have any questions feel free to comment down below.