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 changing the color, the Oculus Guardian system uses to display the VR 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.
Make sure that your Pawn has a OculusRiftBoundy added to it or the following will not work. If you are not certain how to do this, please see the Setting Up Guardian System pages for more information on how to do this.
Create a new Variable called Oculus Rift Boundary Color and set its type to Linear Color and its color to Red.
In the Event Graph add a Event Begin Play and Set Tracking Origin node. Make sure that the Set Tracking Origin node has had its Origin set to Floor Level and then connect the Event Begin Play to the Set Tracking Origin node.
Right - click on the Event Graph and from the menu search for Set Outer Boundary Color, clicking on it to add it to the graph.
Drag both the Oculus Rift Boundary Color variable and the Oculus Rift Boundary component into the Event Graph. Connect the Oculus Rift Boundary Color variable to in the In Boundary Color on the Set Boundary Color node and connect the Oculus Rift Boundary to the Target input.
Connect the output of the Set Tracking Origin node to the input of the Set Outer Boundary Color node and when completed your Event Graph should look like the following.
Click for full image.
Now when you run the level and put the Oculus Rift on when the boundary is displayed, it will be the color you set in the Oculus Rift Boundary Color variable.
Below you will find a link to where you can download the UE4 project that was used to create this example.
Oculus Rift Guardian System Example Project