This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy
Oculus provides samples which illustrate basic VR concepts in Unreal such as Touch, haptics, and the Boundary Component API for interacting with the Guardian System.
Samples are available from the Oculus Unreal GitHub repository. To access this repository, you must hold a UE4 license and be subscribed to the private EpicGames/UnrealEngine repository (see https://www.unrealengine.com/ue4-on-github for details).
All samples require a compatible version of the Unreal Engine which supports the illustrated features. To explore samples, we generally recommend using Unreal versions that we ship from our GitHub repository, which always include the latest features. For a review of which Unreal versions support which features, see Unreal Engine.
BoundarySample is a Blueprint sample that illustrates the use of the Boundary Component API for interacting with our Guardian System. This API allows developers to query the Guardian System trigger state, return the closest boundary point to a queried device or point, and more.
In this sample, the Guardian System Boundary Area is visualized on the ground in orange-yellow, and the Play Area is visualized on the ground in purple.
Two spheres track the Touch controllers. When they approach the Boundary Area, they project a colored arrow toward the nearest sample point in the Guardian Area.

NewGameMode and VRCharacter are used to initialize the scene and make the scene display at the appropriate height, et cetera.
Controls and Behavior
These behaviors are controlled by the BoundarySampleMap, which you can use as a reference for implementing related functionality.
| Test | Control or Behavior |
|---|---|
RequestOuterBoundaryVisible() | Press 'V' on keyboard/right Touch button A to request boundary on. Press 'X'/right Touch button B to cancel. |
SetOuterBoundaryColor() | Press 'G' on keyboard/left Touch button X to set boundary to green. Press 'P'/left Touch button Y to make purple. |
IsOuterBoundaryDisplayed() | If so, cylinder is not visible. |
IsOuterBoundaryTriggered() | If so, cone is not visible (cone should remain if boundaries are requested on by application). |
GetTriggeredOuterBoundaryInfo() | Visualize normals. |
GetTriggeredPlayAreaInfo() | Visualize normals. |
OnOuterBoundaryTriggered Event | Cube made visible. |
OnOuterBoundaryReturned Event | Cube made invisible. |
LayerSample is a Blueprint sample that illustrates the use of VR Compositor Layers to display a UMG UI.
This sample includes two spheres that track with the Touch controllers and two UMG widgets rendered as VR Compositor layers. One is rendered as a quad layer and the other as a cylinder layer.
Because cylinder layers are not currently supported on the Rift, note that the cylinder layer only appears cylindrical when viewed on Gear VR. When the scene is viewed on the Rift, you will only see a quad.

Actor_Blueprint illustrates rendering a UMG widget into a stereo layer. The widget is first rendered into a Material, then the SlateUI texture is pulled from the Material into the stereo layer. This is the UMG widget that is rendered to the quad and cylindrical layers in the sample.
Open MenuBlueprint to open the UMG widget in the UMG Editor.
NewGameMode and VRCharacter are used to initialize the scene and make the scene display at the appropriate height, et cetera.
