Adding VR to an Existing UE5 World
Written By Austin Phan, Spring 2023
UE Version at Publish: Unreal Engine 5.1.1
Alright, so you've setup your UE world with all of your assets, interesting parts, and fun objects. But now, you want to be able to view and traverse your world in VR. What now? UE5's VR template is a great place to start, with a bunch of standard assets that you can start with in order to give you a general starting point with VR.
I. Importing into the World
Skip this if you're starting with the VR template, and have all of the assets for the VR template already.
The first thing that you'll need to do is import the VR templates into your project via the content browser.
Open the content browser and press 'Add(+)'.
Select 'Add feature or content pack'. A new dialog will pop up.
Select 'Blueprint' if not already selected, and then from the below options, select virtual reality. Press 'Add to project'.
Unreal Engine will add the content, and should request you enable a few plugins. Allow enabling of the plugins, and let UE restart.
Add feature or content pack in the content browser.
Add the Virtual reality content to the project.
II. Making the world VR-Compatible
If you have a pre-existing start point for the level, it's recommended that you remove it when implementing the VR pawn.
In the content browser navigate to the area where the VRPawn is located. The normal spot for this is under Content > VRTemplate > Blueprints > VRPawn.
Drag the VRPawn from the content browser into the world, and move it to your starting position. Put it a bit above the ground. No need to put it at 'head height', as when the game starts, the HMD will determine how high your point of view actually is.
Select the VRPawn Actor in the content browser.
Place the VRPawn just above the ground.
Change the 'Auto Possess Player' attribute to Player 0 in the VRPawn that you have placed.
III. Adding Navigation to the world.
If you've tried VR at this point with just the VRPawn inserted, you'll notice that it works, but that you can't move around. You need to add a navigation mesh to the world in order to allow teleportation, and to tell UE5 where you can and cannot teleport.
Add the 'NavMeshBoundsVolume' Volume to the world.
A box should form in front of you, this is the volume for which the user has teleport ability in.
Expand the dimensions of the box to surround the area you want the player to be able to teleport to.
Allow for the navigational mesh to build.
Tip: Pressing 'P' will allow you to see where the mesh goes, with the green areas telling you where you can teleport.
That's it! You can now travel around and view your world in VR. Thanks for reading through this tutorial!