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

VRTK_TouchpadControl

extends VRTK_ObjectControl

Overview

The ability to control an object with the touchpad based on the position of the finger on the touchpad axis.

The Touchpad Control script forms the stub to allow for pre-defined actions to execute when the touchpad axis changes.

This is enabled by the Touchpad Control script emitting an event each time the X axis and Y Axis on the touchpad change 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 changes in the touchpad.

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 touchpad control from affecting a falling user.

Inspector Parameters

  • Primary Activation Button: An optional button that has to be engaged to allow the touchpad control to activate.
  • Action Modifier Button: An optional button that when engaged will activate the modifier on the touchpad control action.
  • Axis Deadzone: Any input on the axis will be ignored if it is within this deadzone threshold. Between 0f and 1f.

Example

VRTK/Examples/017_CameraRig_TouchpadWalking has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.