Guides
These docs are for v3.2.0. Click to read the latest docs for v3.3.0.

VRTK_ButtonControl

extends VRTK_ObjectControl

Overview

The ability to control an object with a button press on a given button to control a specified direction.

The Button Control script forms the stub to allow for pre-defined actions to execute when a button press affects a direction axis.

This is enabled by the Button Control script emitting an event each time the pseudo X axis and pseudo Y Axis are changed by a button press and the corresponding Object Control Action registers with the appropriate axis event. This means that multiple Object Control Actions can be triggered per axis change.

This script is placed on the Script Alias of the Controller that is required to be affected by button presses.

If the controlled object is the play area and VRTK_BodyPhysics is also available, then additional logic is processed when the user is falling such as preventing the button control from affecting a falling user.

Inspector Parameters

  • Forward Button: The button to set the y axis to +1.
  • Backward Button: The button to set the y axis to -1.
  • Left Button: The button to set the x axis to -1.
  • Right Button: The button to set the x axis to +1.