> For the complete documentation index, see [llms.txt](https://spectrexr.gitbook.io/octoxr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spectrexr.gitbook.io/octoxr/locomotion/how-to-use.md).

# How To Use

{% embed url="<https://www.youtube.com/watch?v=C6PmLMTCu7k>" %}
hort video tutorial explaining how to implement locomotion using OctoXR
{% endembed %}

### Setting Up

Drag and drop *<mark style="color:blue;">**OctoHand\_Left**</mark>* and *<mark style="color:blue;">**OctoHand\_Right**</mark>* prefabs as a child of *<mark style="color:blue;">**TrackingSpace**</mark>*.

Reference (for Oculus) *<mark style="color:blue;">**OVRCameraRig**</mark>* to *<mark style="color:blue;">**InputRoot**</mark>* of *<mark style="color:blue;">**MultiSourceInputDataProvider**</mark>* for each hand.

Drag and drop *Teleport* prefab as a child of *<mark style="color:blue;">**OctoHand\_Left**</mark>* or *<mark style="color:blue;">**OctoHand\_Right**</mark>*.

Drag and drop *<mark style="color:blue;">**Footprints**</mark>* and *<mark style="color:blue;">**Teleport Reticle**</mark>* prefabs somewhere in the scene hierarchy. Note that you can use your own custom ones.

### Screen Fader

In order to ease the motion sickness caused by immersive VR world, *<mark style="color:blue;">**ScreenFader**</mark>* was implemented. In the sample scenes, It is mostly used to fade in and out while teleporting (blink teleport) and to fade in when the player is in an uncomfortable situation (perhaps on the edge of the building). Attach it to main camera (in this example *<mark style="color:blue;">**CenterEyeAnchor**</mark>*). Provide it with the material from OctoXR/Materials folder.

![](/files/vNWJ3pTzscn1bLR9ZDFC)

### Locomotion System

Attach *<mark style="color:blue;">**LocomotionSystem**</mark>* component to the *<mark style="color:blue;">**OVRCameraRig**</mark>*. Reference *<mark style="color:blue;">**ScreenFader**</mark>*, *<mark style="color:blue;">**CenterEyeCamera**</mark>* transform and *<mark style="color:blue;">**Footprints**</mark>* game object.&#x20;

![](/files/XN97hbl356WNIdijHCM8)

### Create Teleport Destinations

There are two types of teleport destinations. *<mark style="color:blue;">**TeleportArea**</mark>* which represents larger area where player can freely teleport and *<mark style="color:blue;">**TeleportAnchor**</mark>* where player teleports to the fixed location every time. Add a plane to the scene. Attach it with *<mark style="color:blue;">**TeleportArea**</mark>* component and *<mark style="color:blue;">**Ground**</mark>* component. Add another plane to the scene. Scale it down. This time attach it with *<mark style="color:blue;">**TeleportAnchor**</mark>* component as well as *<mark style="color:blue;">**Ground**</mark>* component. Planes should look somehow like this now:

![](/files/4zI7aC1f3w1b9WVUQLPE)

![](/files/0xUZyD1wcbpzRwPvHsDQ)

### Teleport

There are multiple predefined types of teleport in the OctoXR. Hand tracking teleport and controller tracking teleport. Hand tracking teleport is divided into pinch teleport and custom gesture teleport (Use only one, disable the other). Reference *<mark style="color:blue;">**LocomotionSystem**</mark>*, *<mark style="color:blue;">**BasicHandSkeleton**</mark>, <mark style="color:blue;">**TeleportReticle**</mark>* and *<mark style="color:blue;">**InputDataProviders**</mark>* to corresponding hands on elements of *Teleport* prefab.

![](/files/lJVMQM4KJJSacZ0ivu6s)

### Results

![Teleport Area Example](/files/svVLrrTwcuic1TMI49Gj)

![Teleport Anchor Example](/files/H1iGYT9t1R1twteOLXq4)
