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

VRTK_InteractHaptics

Overview

The Interact Haptics script is attached on the same GameObject as an Interactable Object script and provides controller haptics on touch, grab and use of the object.

Inspector Parameters

  • Clip On Touch: Denotes the audio clip to use to rumble the controller on touch.
  • Strength On Touch: Denotes how strong the rumble in the controller will be on touch.
  • Duration On Touch: Denotes how long the rumble in the controller will last on touch.
  • Interval On Touch: Denotes interval betweens rumble in the controller on touch.
  • Clip On Grab: Denotes the audio clip to use to rumble the controller on grab.
  • Strength On Grab: Denotes how strong the rumble in the controller will be on grab.
  • Duration On Grab: Denotes how long the rumble in the controller will last on grab.
  • Interval On Grab: Denotes interval betweens rumble in the controller on grab.
  • Clip On Use: Denotes the audio clip to use to rumble the controller on use.
  • Strength On Use: Denotes how strong the rumble in the controller will be on use.
  • Duration On Use: Denotes how long the rumble in the controller will last on use.
  • Interval On Use: Denotes interval betweens rumble in the controller on use.

Class Events

  • InteractHapticsTouched - Emitted when the haptics are from a touch.
  • InteractHapticsGrabbed - Emitted when the haptics are from a grab.
  • InteractHapticsUsed - Emitted when the haptics are from a use.

Unity Events

Adding the VRTK_InteractHaptics_UnityEvents component to VRTK_InteractHaptics object allows access to UnityEvents that will react identically to the Class Events.

  • All C# delegate events are mapped to a Unity Event with the On prefix. e.g. MyEvent -> OnMyEvent.

Event Payload

  • VRTK_ControllerReference controllerReference - The reference to the controller to perform haptics on.

Class Methods

HapticsOnTouch/1

public virtual void HapticsOnTouch(VRTK_ControllerReference controllerReference)

  • Parameters
  • VRTK_ControllerReference controllerReference - The reference to the controller to activate the haptic feedback on.
  • Returns
  • none

The HapticsOnTouch method triggers the haptic feedback on the given controller for the settings associated with touch.

HapticsOnGrab/1

public virtual void HapticsOnGrab(VRTK_ControllerReference controllerReference)

  • Parameters
  • VRTK_ControllerReference controllerReference - The reference to the controller to activate the haptic feedback on.
  • Returns
  • none

The HapticsOnGrab method triggers the haptic feedback on the given controller for the settings associated with grab.

HapticsOnUse/1

public virtual void HapticsOnUse(VRTK_ControllerReference controllerReference)

  • Parameters
  • VRTK_ControllerReference controllerReference - The reference to the controller to activate the haptic feedback on.
  • Returns
  • none

The HapticsOnUse method triggers the haptic feedback on the given controller for the settings associated with use.