1.2 - VR Locomotion
Tutorial
·
Beginner
·
+10XP
·
90 mins
·
Unity Technologies

In this lesson, you will learn how to implement various types of locomotion in VR. By the end of this lesson, the user will be able to teleport around your newly furnished room to admire it from all angles.
This lesson is part of the Create with VR course.
Languages available:
Overview Video
1. Fill the room with furniture
You now have a working VR setup and a room, but it’s empty. You need to add spaces in the room where VR interactions can take place.
1. Locate the furniture prefabs:
- In the Project window, open the _Course Library > _Prefabs folders.
2. Define an entryway:
- In one corner of the room, add a Mirror GameObject and Hook GameObject.
3. Define a living area:
- In one half of the room, add a Seating GameObject, a Television GameObject, and a Fireplace GameObject.
4. Define another area:
- Add a Rug GameObject and either a Table GameObject or Storage GameObject to provide a surface.
2. Add snap turning
You’ll next set up the ability to turn around in place so that you can experience the room without physically moving and rotating.
1. Set up Snap Turn:
- Add a new empty GameObject as a child GameObject of the XR Origin (VR) GameObject and name it “Locomotion”.
- Add a Locomotion Mediator component to the Locomotion GameObject; an XR Body Transformer component is automatically added.
- In the XR Body Transformer component, select the Add Character Controller button to add a Character Controller component automatically to the XR Origin (VR) GameObject.
Filename:
Alt text:
2. Add Snap Turn function:
- Create a new empty GameObject as a child GameObject of the Locomotion GameObject and name it “Snap Turn”.

- Add a Snap Turn Provider component to the Snap Turn GameObject.
- Assign the appropriate Input Action asset to the Left Hand Turn Input and Right Hand Turn Input properties by selecting the relevant input action:
- Left hand: XRI Left Locomotion/Snap Turn (Input Action Reference).
- Right Hand: XRI Right Locomotion/Snap Turn (Input Action Reference).
- Drag and drop the Locomotion GameObject onto the Mediator property box.

3. Fine-tune the snap turning experience:
- Experiment with the Turn Amount and Debounce Time properties until you find a setup you like.
- The Turn Amount property defines how far (in degrees) the user rotates each time a snap turn is triggered.
- The Debounce property sets a minimum delay between allowed snap turns to prevent rapid, repeated turns and ensure smooth transitions.
- Enable the Enable Turn Around property to allow the user to turn 180 degrees when they press the joystick down.
3. Add Continuous turn
The Continuous Turn action allows you to smoothly rotate the user’s view in VR, creating a fluid turning experience instead of snap turning.
Warning: This type of motion can be disorienting for people new to VR and Snap Turn is usually the safer option.
1. Set up Continuous Turn:
- Create an empty GameObject as a child of the Locomotion GameObject and name it “Continuous Turn”.
- Add the Continuous Turn Provider component to the Continuous Turn GameObject.
- Assign the appropriate Input Action asset to the Left Hand Turn Input and Right Hand Turn Input properties by selecting the relevant input action:
- Left Hand: XRI Left Locomotion/Turn
- Right Hand: XRI Right Locomotion/Turn
- Drag and drop the Locomotion GameObject onto the Mediator property box.
It’s recommended not to have Snap Turn and Continuous Turn active at the same time; so next, you’ll set it up that the Left Hand Controller GameObject will control continuous turn and the Right Hand Controller GameObject will control the snap turning functions.
2. Set Snap Turn and Continuous Turn movement modes:
If you want to combine Snap Turn and Continuous Turn movement modes, you can configure one hand to perform snap turns and the other to use continuous turning. You can do this by removing the Input Actions for specific hands.
- In the Snap Turn GameObject’s Snap Turn Provider component, set the Left Hand Turn Input property to None.
- In the Continuous Turn GameObject’s Continuous Turn component, set the Right Hand Turn Input property to None.


Your left hand controller should now give Continuous Turn and the right hand controller will have Snap Turn.
4. Add a teleportation area
Now that you can rotate, you should add the function to teleport to different areas within a designated space.
Unlike rotating or moving freely, teleportation instantly places the user at a chosen spot. This can often be a more comfortable way to move around in VR, especially for users who are sensitive to motion.
1. Allow the user to teleport:
- Select the Locomotion GameObject, add a new empty child GameObject, and name it “Teleport”.
- Add a Teleportation Provider component to the Teleport GameObject.
- Drag and drop the Locomotion GameObject into the Mediator property box.
2. Make the rug a teleportation area:
- Select the Rug GameObject and add a Teleportation Area component.
- Drag and drop the Teleport GameObject into Teleportation Provider property.
Now, when you point anywhere on the rug, the line renderer will turn white, and you can use the grip button on the controller to teleport there. The grip button is the lowermost button on the inside of the controller, usually pressed with the middle finger.
Note: If you’re using the XR Device Simulator, you can use T or Y to toggle one of the controllers, use the middle mouse button to aim your ray, then press G to simulate pressing the Grab button.

5. Add teleportation anchors
Sometimes, you want the user to teleport to a specific spot, facing a specific direction. This can be done with Teleportation Anchors.
1. Add Teleportation Anchors to the scene:
- Open the _Course Library > _Prefabs > Rugs folders, then add smaller Mat GameObjects at key locations around the room.
- Rotate these GameObjects so that their local Z axis (blue) arrow is facing the direction you want the user to be when they teleport there.
Note: You must be using Local coordinates to see the local forward direction of the GameObjects.
2. Save changes to all of the mats at once in prefab editing mode:
- Select one of the Mat GameObjects and select the Open button at the top of the Inspector window.
- To make sure your changes are saved in the top-right corner of the Scene view, enable the Auto-save setting.
3. Turn the mat prefab into a teleportation anchor:
- On the Mat prefab, add a new Teleportation Anchor component.
Note: It’s not actually necessary to assign the Teleportation Provider property - it’s assigned automatically when the app runs.
4. Match the orientation of the anchor when you teleport there:
- In the Teleportation Anchor component, set the Match Orientation property to Target Up And Forward.
5. Exit prefab editing mode:
- Select the Back arrow in the upper-left corner of the Hierarchy window.
You should now be able to teleport to the mats around the room, re-orienting to the direction of the mat when you arrive.

Note: To hide the colorful outlines of the GameObjects in the Scene view, in the upper-right corner of the Scene view, select the Gizmos button to hide the Scene view gizmos. You can also open the Gizmos dropdown and enable/disable specific elements.
6. Customize the teleportation reticles
The Line Renderers from your hands change color when you are able to teleport somewhere. You can provide more visual feedback to the user with reticles.
1. Find the reticle you want to use:
- Open the _Course Library > _Prefabs > VR > Reticles folders and determine which Reticle you prefer.
2. Assign a custom reticle for the Teleportation Area rug:
- Select the large Rug GameObject with a Teleportation Area component.
- Drag and drop your chosen Reticle prefab into the Custom Reticle property of the Teleportation Area component.
3. Assign a custom reticle for the Teleportation Anchor mats:
- Open one of your Mat GameObjects in prefab editing mode.
- In the Teleportation Anchor component, assign the Reticle prefab to the Custom Reticle property.
- Exit prefab editing mode.
The custom reticle should now appear at the location where the line renderer meets the teleportation destination.

7. Recap
New features:
- Designed room
- Turning rig
- Teleporting rig
New concepts and skills
- Types of locomotion
- (Snap Turn/Continuous Turn/Teleport)
- Vection and simulator sickness
- Teleportation areas vs anchors
Next lesson:
- Grabbable GameObjects
8. Extension Activities
If you want to further develop your skills, explore new concepts, and improve your project, check out some of the extension activities below. Each one is tagged as [Easy], [Medium], [Difficult], or [Expert] to indicate the level of challenge and will also include a [Requires Programming] tag if relevant.
These are completely optional, but highly encouraged if you want to take your VR development to the next level.
1. Research other VR movement [Easy]
Look into other less common forms of VR movement, including projectile warping, scripted movement, projected avatar, world-pulling, etc.
- Search online for “VR movement types” to find other interesting strategies for VR locomotion.
2. Create your own Art [Medium]
Add your own custom piece of art to the room to make it uniquely your own.
- You can create your own masterpiece or find one online that you have the rights to use (search for “creative commons 0”).
Hint: You’ll need to create a new Material and assign your image as the Base Map of that material, then apply that material to a GameObject.

3. Animated reticle [Medium] [Requires Programming]
Make the teleportation reticle spin around and/or scale up and down to make the experience feel more dynamic.
Hint: Create a custom rotation script and apply it to the Reticle prefab.