Moving Around in Your Game: Locomotion

Learn how to navigate in the game using locomotion.

Locomotion

After setting up a game environment, interaction and movement within it make the experience more immersive. Depending upon the gameplay, the user can move within a VR environment. This movement can be performed artificially by using controllers or naturally by an omnidirectional treadmill (supports walking and running on it). For our first project, we’re going to implement a few locomotion techniques using controllers.

Navigation configurations

In this part, we’ll enable two locomotion features for the user. The fundamental movements are snap turn and continuous move. Follow the steps below to set up the locomotion.

  1. Right-click “XR Origin” in the “Hierarchy” panel and navigate to “XR > Locomotion (Action based).”

  2. Click “Locomotion (Action based)” and select “Locomotion System” that was created in the “Hierarchy” panel.

  3. We can see that there is a “Snap Turn Provider (Action-based)” option, which is already enabled in the “Inspector” panel. We’ll enable the “Snap Turn Provider” for “Right Hand Snap Turn Action.” So, we’ll disable the “Use Reference” option for the snap movement.

  4. Click “Add Component” and search for “Continuous Move Provider (Action-based).”

  5. In the “System” option of “Continuous Move Provider (Action-based),” select “Locomotion System.”

  6. In the same scene, we also want to enable “Continuous Move Provider (Action-based)” for the left controller only. For this, enable “Use Reference” for “Left Hand Move Action” and disable it for “Right Hand Move Action.”

We can follow the slides below to add the Locomotion Providers.

Get hands-on with 1200+ tech skills courses.