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

VRTK_Slider

extends VRTK_Control

Overview

Attaching the script to a game object will allow the user to interact with it as if it were a horizontal or vertical slider. The direction can be freely set and auto-detection is supported.

The script will instantiate the required Rigidbody and Interactable components automatically in case they do not exist yet.

Inspector Parameters

  • Direction: The axis on which the slider should move. All other axis will be frozen.
  • Min: The minimum value of the slider.
  • Max: The maximum value of the slider.
  • Step Size: The increments in which slider values can change. The slider supports snapping.

Example

SteamVR_Unity_Toolkit/Examples/025_Controls_Overview has a selection of sliders at various angles with different step values to demonstrate their usage.