Language:
Page Info
Tags:
Skill Level:
Engine Version:

Detect SteamVR Chaperone System Activation

Choose your OS:
Prerequisite Topics

This page assumes you have prior knowledge of the following topics. Please read them before proceeding.

SteamVRChapActivation_Hero_Image.png

The SteamVR Chaperone system is used to display the boundaries of the VR interaction area. As a tracked device approaches the boundaries, the SteamVR 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 Chaperone system to work, you will need to make sure you have set up Room Scale VR using the SteamVR tools. For more information on how to do this, please see the official HTC Vive Setup pages.

It is NOT possible nor advisable to disable the Chaperone 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 SteamVR Chaperone Boundary, we first have to know when one of the user's devices is close to it. To figure this out inside UE4, we can use the Bind Event to OnRetunToBounds and Bind Event to OnLeaveBounds nodes. Inside of your player Pawn Blueprint add the following nodes to the Event Graph.

    Click for full image.

    Node Name

    Value

    Bind Event to OnReturnToBounds

    N/A

    Bind Event to OnLeaveBounds

    N/A

    SteamVRChaperone

    N/A

  1. Over in the Variables panel, create a new Boolean variable called inBounds so that we can track when the user leaves and enters the Chaperone bounds.

    SteamVRChapActivation_01.png

  2. Next, we want to make sure that as soon as the level starts, we are checking to see if the user is close to the bounds or not. To do this, we need to connect the Bind Event to OnRetunToBounds and Bind Event to OnLeaveBounds nodes together and then connect the SteamVRChaperone Object Reference to the Target input on both Bind Event nodes. Finally connecting the input to the Bind Event to OnLeaveBounds node to the output of the Set Tracking Origin node. When completed, your Pawn Blueprint should look like the following image:

    Click for full image.

  3. Now we need to create some Blueprint logic that will help us track when the user has left or entered the bounds so that we display the appropriate message. To do this, we first need to create two new Custom Event nodes named ReturnToBounds and LeaveBounds. Next, we need to set the In Bounds variable to True when we Return To Bounds and False when we Leave Bounds. When completed, your Pawn Blueprint should look like the following image.

    Click for full image.

  4. Next, we need to connect the ReturnToBounds and LeaveBounds Event output to the respective input on the Bind Event nodes so that we can track when the users have returned or left the Chaperone bounds. When completed, your Pawn Blueprint should look like the following image.

    Click for full image.

  5. We now need a way to notify the user that they have left or returned to the tracking area. To do this, we can use the Print String node and print a message to the screen every Tick that lets the user know if they are in or outside the tracking area. To set this up in your Pawn Blueprint, you will need to add the following nodes to the Event graph.

    Node Name

    Value

    Event Tick

    N/A

    Branch

    N/A

    Print String x 2

    N/A

    InBounds

    N/A

  6. Connect the Event Tick output to the input on the Branch node and connect the InBounds to the Condition input and then connect the Print String nodes to the True and False outputs on the Branch node. Make sure to input some text in the Print String nodes that describes what is going. For this example the phrase You have returned to the tracking bounds and You have left the tracking bounds were used but feel free to use whatever you like.

    When completed your Pawn Blueprint should look like the following image.

    Click on image to copy Blueprint code.

End Result

Now, put on your HTC Vive HMD, pick up your Motion controllers and launch the project using VR Preview. Once the project launches, slowly move one of the Motion controllers to towards the Chaperone boundary, and as soon as you get close, the message that is printed to the screen will change 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