Unity VR: Locomotion Movement

5 min readApr 7, 2025

Setup

To add locomotion in VR, you will need to add a Locomotion Mediator component to the XR Origin. This will automatically, and if it doesn’t you should, add an XR Body Transformer to the XR Origin. Just make sure the XR Origin that the XR Body Transformer is attached to is assigned to the XR Origin reference.

Locomotion Mediator

The Locomotion Mediator is a component in the XR Interaction Toolkit (XRI) that manages access to movement systems like teleportation, snap turning, or continuous movement to ensure they don’t conflict with each other. It is the central authority to decide when and which locomotion providers (teleportation, climbing, etc.) are allowed to move the player.

In XR, multiple systems might try to move the player at the same time like a player tries to teleport while a snap turn is in progress or climb while trying to do continuous movement. Without a mediator, these can interfere or cause unexpected behavior.

XR Body Transformer

The XR Body Transformer is a component that automatically updates the position and orientation of a user’s virtual body or avatar in response to player movement — like teleporting, climbing, or smooth movement. It ensures that the in-game body representation of the user stays aligned with their real-world movement and the XR Origin.

Turn Providers

In the XR Interaction Toolkit (XRI), Snap Turn and Continuous Turn Providers are components that let players rotate their XR Origin (the player rig) using their input devices — typically thumbsticks or touchpads on VR controllers.They both provide rotation-based locomotion, but in different ways.

Snap Turn

Snap turning rotates the player in fixed angle increments, such as 45° or 90°, instantly.

Make sure to use the Snap Turn Provider, which allows you to use the Input System and the already created XRI Actions which can be assigned to the Left & Right Hand input or use the Presets. You will also need to assign the Locomotion Mediator to the reference slot.

  • Instant rotation without animation or in-between frames.
  • More comfortable for VR users prone to motion sickness.
  • Customizable turn angle and turn input (e.g., left joystick X-axis)

It might be a good idea to only have one of the controls have Snap Turn since both may cause conflicting movements. You can set either Left or Right input to unused to disable the Snap Turn.

Continuous Turn

Continuous turning smoothly rotates the XR Origin as long as the input is held, like turning your character in a traditional game using analog stick movement. Make sure to use the Continuous Turn Provider, which allows you to use the Input System and the already created XRI Actions which can be assigned to the Left & Right Hand input or use the Presets. You will also need to assign the Locomotion Mediator to the reference slot.

  • Fluid rotation based on how long and how far the stick is tilted.
  • Feels more like traditional FPS controls.
  • Can cause motion sickness for some users.

You can include both providers in your project and let the player toggle between them using an in-game comfort settings menu!

Continuous Move Provider

The Continuous Move Provider in the XR Interaction Toolkit (XRI) allows players to move smoothly through the VR environment using a joystick or touchpad input, similar to traditional first-person movement in video games. Instead of teleporting, it provides fluid motion in the direction the player chooses.

You will just need to assign the XR Origin it is attached to and the Left and Right inputs from the default Action Asset or use the Presets.

  • Smooth, FPS-style movement instead of teleportation.
  • Customizable speed and movement direction.
  • Works with gravity to allow realistic walking on uneven terrain.
  • Can be combined with snap/continuous turning for full locomotion control.

Just like the Snap Turn, it might be a good idea to have only one of the Left or Right inputs to control the Movement to prevent them from overlapping and conflicting. Since I already have the Right input controlling the Snap Turn, I will set the Right Input to Unused to disable it, leaving the Left input to control the Continuous Movement.

Properties:

  • Move Speed — Controls how fast the player moves
  • Use Gravity–Enables physics-based falling instead of floating
  • Forward Source–Defines movement direction: Head, Hand, or World
  • Input Action–Defines which input controls movement (e.g., Left Joystick Y-axis)

Forward Source

When the player pushes “forward,” should that mean–In the direction their head is facing or in the direction their controller/hand is pointing? That is what the Forward Source determines and there are two main sources

Main Camera (Head):

  • Movement is based on the direction the headset is facing.
  • Most natural for first-person VR experiences.
  • Common default for smooth locomotion.

Controller (Left or Right Hand):

  • Movement is based on the controller’s forward direction.
  • Useful when you want to move where you point, even if you’re looking elsewhere.
  • Good for games with pointer-style navigation or climbing mechanics.

Conclusion

Understanding and implementing these locomotion methods within Unity’s XR Interaction Toolkit is crucial for creating engaging and comfortable VR experiences. By carefully configuring the Locomotion Mediator, Turn Providers, and Continuous Move Provider, developers can offer players diverse and intuitive ways to navigate virtual environments. Remember to consider user comfort and prevent input conflicts for a seamless VR

--

--

No responses yet