Create Locomotion Interactions
Updated: Mar 20, 2025
In this tutorial, you will learn how to use Interaction SDK locomotion interactions to teleport or snap turn to a location in your Unity scene using your hands or controllers. You will also be able to configure your entire scene to traverse it using slide and step locomotion modes.
To teleport, you need to add a teleport interactable. The most basic type is the Hotspot, which defines an absolute locomotion target in the scene.
Create a new GameObject. It can be an empty one or a 3D-asset Cube, to be used as a Hotspot. Place it where you desire to teleport to.
Right-click in the GameObject Hierarchy and select Interaction SDK / Add Teleport Interactable. This will open a Wizard that allows you to create several types of Teleport Interactables.
Select Hotspot as a Type in the wizard, click on Fix-All if anything is missing, and then select Create. If you didn’t add the relevant Interactors, the wizard will try to create them.
Note
You can quickly define a teleportable area and out of bounds so users can teleport anywhere within the area, or block the Teleport Arc from going through walls or colliders in an specific layer. To do so, change the InteractableType in the wizard to Plane, NavMesh, or PhysicsLayer and turn Allows Teleport on or off as desired.
When using slide locomotion, the moving character collides with the world and falls to the ground. So one must make sure that there are no spots they can fall through. Follow these steps to enable smooth locomotion:
- use the
ComprehensiveRig
that has everything wired for locomotion in place using the menu GameObject > Interaction SDK > Add OVR Interaction Rig.
Alternatively you can copy the Locomotion
prefab into your scene. Redirecting all your ILocomotionBroadcasters
to the LocomotionEventsConnection
placed in the root. It routes the events to the FirstPersonLocomotor
inside. Alternatively you can just
Place colliders on all the physical obstacles in your level and mark them with the same physics layer (such as Default).
In the CharacterController
make sure the colliding layers are set to those of the obstacles. Try to avoid having grabbable objects, player colliders and panels in the same layer to avoid undesired collisions.
Also adjust the other parameters in the CharacterController
such as the Max Slope and Max Step to ensure the character can move up slopes and small steps, but prevent it from going into steep ones.
If you want to enable physically walking into hotspots, first make sure they are using collider Triggers so they won’t block the movement. Then add the Tag Set Snappable to the TeleportInteractable
gameObject.
Prepare to launch your scene by going to File > Build Settings and clicking the Add Open Scenes button.
Your scene is now ready to build.
Select File > Build And Run, or if you have a Link connected, click Play.
Tap your thumb against the side of the index or press the joystick forward on your controllers. A ray is emitted from your hands or controllers. Aim it to the teleport hotspot or a teleportable area and either tap your thumb again (if using hands) or release the joystick (if using controllers), to teleport to that location.
If Slide locomotion is enabled for controllers, use the left joystick to move around the scene, colliding with the world. The right joystick will allow you to turn. You can also crouch by pressing the right joystick down, jump with the A button, sprint by clicking the left joystick and select a hotspot under your feet with the X button.