Updated on
October 12, 2023
Moving inside a VR application gives an immersive experience, and moving by walking around in reality will allow for even more immersiveness. But sometimes the space the user has available will not allow it, which is a common occurrence. In this case, we will need to find other ways to move around in VR, especially to overcome long distances.
In this VR Builder tutorial, you will learn how to move inside VR using VR Builder and Unity. In this tutorial you will learn about
Free teleportation is the “default” or most common way of moving around in VR, this type of teleportation allows you to jump around the experience in a predefined area. This could be a whole space, or something like a road.
For this demonstration we have created a new empty project and imported VR Builder, if you have any doubts about this, I recommend following the setup tutorial before continuing with this one.
We will start by creating a plane. Add a plane game object, adjust it to a size in which the user will be able to move around, make sure there’s a collider in the plane either this be a mesh collider or a box collider and set the layer to XR Teleport. Another object that we must add is a teleportation area component.
In this component we have to make sure of two things.
And now the user will be able to move inside your application.
Troubleshooting
If this is not working out of the box, some misconfiguration might have happened when importing VR Builder. But don’t worry, it’s an easy fix.
In the hierarchy, click dropdowns related to [XR_Setup_Action_Based_Hands] until we find the Left Teleport Controller and Right Teleport Controller.
Look for the XR Ray Interactor component, There we have the Interaction Layer Mask which is set to “Nothing”. Let’s set it to “XR Teleport”.
For some VR experiences, it is meant for the user to be in specific places of the environment, maybe a training table, where they are supposed to perform some action before moving to the next spot. In these cases anchored teleportation serves as a guide to the user as it highlights the place where the user is supposed to go and restricts teleportation, so they can only move to that desired spot..
Now, let’s guide the user by using Anchored teleportation.
To set it up, create an empty game object, rename it to Teleport point A and position it where you want your target position to be.
Inside the process editor (previously called Workflow Editor in older VR Builder versions), create a new step and connect it.
In the step inspector create a transition condition VR User>Teleport.
Drag the Teleport point A game object to reference it as the Teleportation point. Click on fix it.
Go back to the Teleport point A game object, as you can see some properties have been added to the game object. In Teleportation Property, we have a new option enabled “Set default Teleportation Anchor”, click on it. This will create a nice visual effect.
Now the teleportation point is up and running.
To improve the experience,
One really cool thing about teleportation anchors is that they will only be enabled, by enabled I mean visible and functioning, during the steps when the user is intended to go to these places. if we were to add a Teleport point B or a teleport Point C in a succession of steps. Teleport Point A would be visible at first, when completed Teleport point B would become visible while Teleport Point A invisible, and so on.
Troubleshooting
Sometimes, you can’t see any visual effect when pointing to move to the Anchor point. If you would like to fix this or set your own visual effect, select the anchor you would like to modify, and in the inspector look for the Teleportation Area Component.
In Custom reticle, I will set the default reticle which is “Teleport reticle” But here you can set your own custom effect.
If setting a teleportation achor manually it is important to switch the Teleport Trigger to “On Deactivated”, you will be able to find it on the teleportation anchor component, scroll down to Teleportation Configuration as done previously with the Teleportation Area switch
There are two types of movement in VR, this can be continuous or non-continuous.
So far we have been experimenting with non-continuous movement which is teleporting, now we will show you continuous movement.
This is constant and uninterrupted movement, as anyone would move in any other game. This type of movement is not so common in VR experiences as it may, and most probably will, cause motion sickness especially in people not used to VR or advanced in age. So we kindly advise against using it.
Continuous movement is accessible and configurable by clicking on the dropdown of [XR_Setup_Action_Based_Hands] selecting the XR Rig and scrolling down to the Locomotion Scheme Manager component.
By changing the Move scheme to continuous, the VR user will be able to use the left joystick of the controller to move inside the experience.
Turning around in real life while using a VR application, is not always possible as we might bump into some objects. In this case the simulated turning around in VR comes handy.
You will be able to turn around by moving your right controller joystick. How it turns around is configurable, by modifying the Turn Style, from Snap to Continuous you can access a more constant type of turn, but this is the ultimate stomach test! Motion sickness is almost unavoidable in this turn style..
Let’s go back to snap for now.
This snap turn can also be configured by angle in the Snap Turn Provider component, in this case we have a default value of 45 degrees as it is a standard, but 90 degrees are used as well in some applications. We recommend maintaining the 45 degree standard, but feel free to experiment with this number.
This would be it for this video, in this VR Builder tutorial you have learned how to add movement to your VR Builder application, and how to customise it. Now how about you start experimenting with snapzones?
If you have any questions, join the VR Builder community on discord to get in touch with VR Builder users and developers.