In order to start with the tutorials, you will need the following software and hardware. As I have mentioned in my previous post, for the most part, the tutorials can be followed with the VR set-up but if your intention is to make a game for VR then you can follow the tutorials exactly.
- A PC that can comfortably make run Unreal and VR. I am not going to go into the details of this. If you can work with it and meets the requirements for Oculus Rift and Unreal Engine that is fine.
- Oculus Rift. The VR headset for development.
- Unreal Engine 4.20.2 When new versions of the software are released I will either put the changes in the comments or make a post with the upgrade instructions.
Project Creation & Setup:
The first thing that we will do is to create a new project. Since the goal of the tutorial is to create the everything from scratch ourselves. Let’s start by creating a C++ blank project by opening up the epic games launcher.
Once the project creation is completed, Unreal Editor window is opened and you should be able to see an empty scene with no contents similar to what we have below. If you are not familiar with the Unreal editor windows you can check out the documentation here.
The next step would be to configure the project for VR.
The process of getting the plugins required to start VR development is super simple in UE4. Let’s open the “Plugins” windows by selecting the “Edit->Plugin” menu item in the editor. In the plugins window, select the “Virtual Reality” option on the left-hand panel. Scroll down on the right-hand panel and make sure that the “OculusVR” and “SteamVR” plugins are enabled.
First, we would need a scene that the game would launch into. For this tutorial, we will just create a new default map and save it to disk. I have called mine “PlayGround” and saved it in “Content\Maps“.
Next, we will set this as the start up map and for the launch game in the build.
The last setting we would need to do before we start testing the build would be to set the “Start In VR” setting in the project settings.
Before we start making the build, let’s test the project in the editor. You should have a “VR Preview” play button that shows up when you click on the little drop-down arrow next to the play button.
If this option is greyed out for you, check if SteamVR / oculus has recognized your device. If the HMD is not connected you might have to connect all the cables until it is detected properly in oculus / SteamVR. You might need to restart the UE4 editor.
Hitting the VR preview button should now show you the feed of the scene in your Oculus. See the video below for a reference of how the output should be in the HMD.
The next step would be to package the project and test if the build works.
Packaging the project is straightforward and does not need any special settings or steps beyond what has already been done.
Finally here is a video showing the out in the editor as well as the packaged build.
As you can see in the output video we don’t have a lot going on at the end of this tutorial but we do have a working build that is set-up for VR.
In the next tutorial, we will set-up the motion controllers so that they are tracked.