Set Up a Seated Camera for the Oculus Rift

Setting up the UE4 camera to work with a seated Oculus Rift experience.

One of the first things you will need to think about when starting to develop any Unreal Enging 4 (UE4) powered VR experience to be used with the Oculus Rift is deciding whether the experience will be a seated one or a standing one. In the following How - To we will take a look at how to setup your UE4 projects VR camera for a seated Oculus Rift VR experience.

Steps

Below you will find instructions on setting up a Pawn to work with a seated Oculus Rift experience.

First, open up or create a new Pawn Blueprint and then go to the Component section of the Viewport tab. From there add the following two components with the following names, making sure that the VRCamera is a child of VRCameraRoot:

Component Name

Value

Scene

VRCameraRoot

Camera

VRCamera

Click for full image.

When

No matter what VR HMD you are using, this is the Epic recommend way to set up a VR camera as it allows you to offset the position of the camera without having to move the actual camera.

In the Pawn Blueprint go to the Event Graph and drag off the Event Begin Play node to show the Executable Actions list. In the list search for the Set Tracking Origin node and click on it to add it to the Event Graph.

Click for full image.

The Set Tracking Origin node has two options, Floor Level and Eye Level. For a seated experience you will need to set the Origin of the Set Tracking Origin node to Eye Level.

Click for full image.

Next, in the Variables section of the My Blueprint tab, create a new Vector variable called RiftCameraHeight and set the Z value to 121.

For a seated Rift experience, you will always want to set the height of the camera to match the real world seated height of the user in Centimeters.

Then, drag off the output of the Set Tracking Origin node and search for the Set Relative Location node, selecting the SetRelativeLocation(VRCameraRoot) option.

Click for full image.

Connect the RiftCameraHeight variable to the New Location input on the Set Relative Location node and then press the Compile button and when completed your Event Graph should look like the following image.

You can copy the completed Blueprint by clicking on the upper left-hand corner of above and pressing CRTL + C to copy the graph. Once copied, go to your Blueprints event and press CTRL + V to paste it in.

Drag the Pawn Blueprint from the Content Browser to a level, making sure that it is placed at 0,0,0 in the level.

Click for full image.

Select the Pawn Blueprint that was put in the level and in the Details panel under the Pawn setting, set the Auto Possess Player from Disabled to Player 0.

Click for full image.

End Result

Finally, go to the Main Toolbar and change the Play Mode to VR Preview and then press the Play button. When you put your Oculus Rift HMD on and view the level while sitting down, you should see something similar to the following video.

UE4 Project Downloads

Below you will find a link to where you can download the UE4 project that was used to create this example.

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.