Menu
Lumberyard
User Guide (Version 1.11)

Setting Up a Basic Virtual Reality Flow Graph

The following flow graph examples guide you through a basic setup of a virtual reality level and its accompanying head-mounted display(s).

When you create a new level, the default point of origin is 0,0,0—the location at which the level starts during game play. You can specify a custom starting point by placing a camera at a specific location and enabling it with flow graph.

To specify a custom starting point

  1. Place a game play camera at the desired location in your level. This is your default camera.

  2. Right-click the camera entity and click Create Flow Graph to open the Flow Graph editor.

  3. Drag a Game:Start node and Camera:View node onto your flow graph canvas.

  4. Connect the Game:Start node's output output to the Camera:View node's Enable input.

  5. Right-click Choose Entity and click Assign graph entity.

During virtual reality game play, a player may need to recenter their game play world around themselves, and start from a known position in space, regardless of their current position. Using flow graph, you can add a keyboard shortcut that the player can use to accomplish this.

To add a keyboard shortcut for recentering

  1. Open the Flow Graph editor.

  2. Drag a Debug:InputKey node and VR:RecenterPose node onto the canvas.

  3. Connect the Debug:InputKey node's Pressed output to the VR:RecenterPose node's Activate input.

  4. On Debug:InputKey node, click on Key= and set the key to the shortcut key you want to use.

For your virtual reality game, you may want to place a graphical, virtual controller to represent where a physical controller is within the 3D space. You can use flow graph to add this graphical representation of a controller (for example, hands, weapons, and so on).

For this procedure, the default camera is the game play camera that you placed in the custom starting point procedure. Assigning the default camera entity to the VR:ControllerTracking node ensures that the motion controllers are aligned in the same space.

To add virtual controllers and assign the default camera

  1. In the Perspective viewport, select the default camera.

  2. In Flow Graph editor, drag the VR:ControllerTracking node onto the flow graph canvas.

  3. Right-click Choose Entity and click Assign Graph Entity.

  4. In the Perspective viewport, place one or more entities that you want to use as controllers into your level. Ensure that you keep the entity selected.

  5. In the Flow Graph editor, drag one or two Entity:EntityPos nodes onto your flow graph canvas.

  6. On the Entity:EntityPos node, right-click Choose Input and click Assign selected entity.

    If you placed another entity that you want to assign as the other controller, select the entity and repeat this step for the other Entity:EntityPos node.

  7. Connect VR:ControllerTracking node's Left Pos output to the Entity:EntityPos node's pos input.

  8. Connect VR:ControllerTracking node's Left Rot (PRY) output to the Entity:EntityPos node's rotate input.

  9. Repeat the previous two steps for the Right Pos and Right Rot (PRY), if applicable.