Detect Oculus Rift Guardian System Activation

Detecting if the user has activated the Oculus Rift Guardian system.

Choose your operating system:

Windows

macOS

Linux

Prerequisite Topics

In order to understand and use the content on this page, make sure you are familiar with the following topics:

HTGuardian_Hero_Image.png

The Oculus Guardian system is used to display the boundaries of the VR interaction area. As a tracked device approaches the boundaries, the Oculus Runtime automatically provides visual cues notifying the user of this. In the following How - To we will take a look at how to display the interaction as well as other visual cues to notify the users that one of their devices is outside or are close to going outside the interaction area.

For the Guardian system to work, you will need to make sure you have set it up using the Oculus App. For more information on how to do this, please see the official Oculus Guardian System Setup pages.

It is NOT possible nor advisable to disable the Guardian system from inside UE4. You can, however, adjust how UE4 will react to the user getting close to the boundaries.

Steps

  1. To display the Oculus Rift Boundary, we have to know when one of the user's devices is close to it. The node Is Outer Boundary Displayed will allow us to do just this but we need a way to check this each tick. For us to be able to do this in UE4 we will first need to add the following nodes to the Event Graph:

    Node Name

    Value

    Event Tick

    N/A

    Branch

    N/A

    Is Outer Boundary Displayed

    N/A

    Oculus Rift Boundary

    N/A

  2. Once the nodes have been added, we will need to connect them so that the Is Outer Boundary Displayed node is only called when a user's device gets close to the boundary; otherwise, we do not want anything to happen. To achieve this, setup up your Event graph to match the following image:

    Click for full image.

  3. Next, we want to display not only the boundaries that the user setup in the Oculus App but also the square/rectangular interaction area that fits within those boundaries. To do this, we are going to look at all the points within the play area using the Get Play Area Points node. Then to determine the size of the square/rectangular interaction we will go through each point using a For Loop and at each point, we draw a point and connect each point with a line display this information to the user. To achieve this, setup up your Event graph to match the following image:

    Click on image to copy Blueprint code.

  4. When that is completed, make sure to connect the For Loop to the True output of the Branch node and do not forget to Compile and Save your Blueprint. When completed your Blueprint Event graph should look like the following image:

    Click for full image.

End Result

Now, put on your Oculus Rift HMD on, pick up your Touch controllers and launch the project using VR Preview. Once the project launches, slowly move one of the Touch controllers to towards the Guardian boundary. When the Guardian boundary is displayed, you should also see the square/rectangular interaction area being displayed like in 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.

Tags
Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss