Locomotion, Freedom in VR
Objective: Understanding what Locomotion is, and how to set up in your scenes!
The XR Interaction Toolkit package provides a set of locomotion primitives that offer the means to move about a Scene during an XR experience. Locomotion is technically the connecting block for our XR Origin to actual movement.
To create we need to select the XR Origin and in the inspector select add component.
Search for the Locomotion and add to XR Origin.
Great, now we need to connect the XR origin to the Locomotion.
With the locomotion set up now we can add movement to our player. You have options, such as, turning. You can either choose snap turning or continuous turning. Continuous turning is a smooth turning system; however, more people report to have motion sickness with continuous as appose to the snap turning. They are both equally simple to set up.
Select add component and search for snap turning.
We can either manually set up the references for the actions or we can use the preset that unity provided us.
This connects the action map.
When you use the preset, it will automatically attach the left hand and the right hand. This means no matter what hand you press the joystick on the player will turn. This can become a conflict later when you add movement so I would choose only one hand and disable the other.
Lastly, we need to connect the Locomotion system to the snap turn system.
Speaking of movement let’s create that next. Following the same pattern, click add component and search for movement.
Simply add the preset, unless you want to set the references manually.
The same warning applies here, since I am using only the right hand for turning, I will use the left hand for movement.
We need to connect the locomotion system.
What this has that the turning system doesn’t have is a forward source setting. We have two options for this. We can either choose the headset as the source, or a hand. You can experiment and choose what feels the best for you. For me, I will choose the hand.
This is all you need, now when you load into your scene you player will now be able to move and turn thanks to the Locomotion System! Don’t be afraid to experiment with your settings and I’ll see you in the next tutorial!