ParelVRDocs
Player site

Scripting / Reference

Input

Types in the ParelVR.Volt.Input namespace.

VoltInput#

ParelVR.Volt.Input.VoltInput static

The local player's input as actions. Scripts never see keys, buttons, devices or anything typed into a text field, and input is not reported while a ParelVR menu is open.

VoltInput methods#

static bool GetAction(VoltInputAction action)

True while an action is held.

static bool GetActionDown(VoltInputAction action)

True in the frame an action was pressed.

static bool GetActionUp(VoltInputAction action)

True in the frame an action was released.

static Vector2 GetAxis2D(VoltInputAction action)

The two axes of Movement or Turn, each from -1 to 1.

static float GetValue(VoltInputAction action)

How far an action is pressed, 0 to 1. Buttons read 0 or 1.

VoltInputAction#

ParelVR.Volt.Input.VoltInputAction enum

An action a player can perform, whatever device they use for it.

Value Meaning
Movement (0) Walking: an axis pair read with GetAxis2D.
Turn (1) Turning: an axis pair read with GetAxis2D.
Jump (2)
Interact (3)
Grab (4)
Use (5)
Menu (6)
Primary (7)
Secondary (8)
Trigger (9)
Grip (10)
Run (11)
Crouch (12)

VoltVRInput#

ParelVR.Volt.Input.VoltVRInput static

Input that only exists in VR.

VoltVRInput properties#

static bool IsVR { get; }

True when the local player is in VR.

VoltVRInput methods#

static float GetGrip(VoltHand hand)

How far the grip of a hand is squeezed, 0 to 1.

static Vector2 GetStick(VoltHand hand)

The thumbstick or touchpad of a hand, each axis from -1 to 1.

static float GetTrigger(VoltHand hand)

How far the trigger of a hand is pulled, 0 to 1.

static void PlayHaptics(VoltHand hand, float strength, float seconds)

Vibrates a controller.