Guides
Guides
These docs are for v3.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

  • Connected To: An optional game object to which the wheel will be connected. If the game object moves the wheel will follow along.
  • Direction: The axis on which the slider should move. All other axis will be frozen.
  • Minimum Limit: The collider to specify the minimum limit of the slider.
  • Maximum Limit: The collider to specify the maximum limit of the slider.
  • Minimum Value: The minimum value of the slider.
  • Maximum Value: The maximum value of the slider.
  • Step Size: The increments in which slider values can change.
  • Snap To Step: If this is checked then when the slider is released, it will snap to the nearest value position.
  • Released Friction: The amount of friction the slider will have when it is released.

Example

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