Table of Contents

Controller Button Interaction

This interaction is used to detect when the user presses a key or button on any of the platforms that VIROO supports (except hand tracking):

  • XR with controllers and CAVE: can be used to detect that the user presses keys on their controllers.
  • Desktop: on desktop, with keyboard and mouse, keyboard keys can be detected.

Add a Controller Button Press Interaction to a GameObject

To use button type interactions you must:

  1. Configure the Interactable Object with the necessary components.
  2. Add the Actions you want the object to trigger.

Set up the Controller Button Press Interactable object

To make an object respond to pressing a button it must have, at least, a ControllerButtonPressInteraction component, which is a VIROO Interaction System component.

ControllerButtonPressInteraction
Field Description
Controller Selects whether to detect a left or right controller button press.
Button Select which key on the controller is to be detected.
Keyboard Button Which key on the keyboard do you want to detect on desktop platform.
Press Button Actions The list of Actions to be triggered when the key is pressed.
Release Button Actions The list of Actions to be triggered when the key is released.

On the right controller, the available buttons are Primary Button, Secondary Button and Trigger Button. On the left controller, however, only SecondaryButton and TriggerButton are available, this is because the Primary Button on the left controller is used in VIROO to display the menu. In the Keyboard Button option you can select any key for desktop systems.

On CAVE systems you should select the right Controller, as the Flystick on these systems behaves as a right controller.

controller-button-press-interaction.png

Add Actions

At this point you can add the desired Actions for when the button press interaction is performed by a user.

Both the PressButtonActions and ReleaseButtonActions fields of ControllerButtonPressInteraction support dragging the Actions triggered by this interaction. To see the Actions available in VIROO go to Actions and to see how to create your own actions go to Extend the Interaction System.

Add to the scene the Action you want to perform when this interaction occurs, in this example we will be using a MoveAction.

controller-button-press-interaction-move-action.png

And now, drag the MoveAction action to either of the two available options depending on your need: PressButtonActions or ReleaseButtonActions.

controller-button-press-interaction-actions.png