void TriggerHaptics( HapticEffect effect, float lengthScale, float frequencyScale, float amplitudeScale )

robot_2Generated
code_blocksInput

Description

The TriggerHaptics method is used to initiate a haptic feedback effect on a VR controller. This method allows you to specify the type of haptic effect and scale its length, frequency, and amplitude to customize the feedback experience.

Usage

To use the TriggerHaptics method, you need to provide the following parameters:

  • effect: A HapticEffect that defines the type of haptic feedback to be triggered.
  • lengthScale: A float value that scales the duration of the haptic effect.
  • frequencyScale: A float value that scales the frequency of the haptic effect.
  • amplitudeScale: A float value that scales the amplitude of the haptic effect.

Call this method on an instance of VRController to trigger the desired haptic feedback.

Example

// Example of triggering a haptic effect on a VR controller
VRController controller = new VRController();
HapticEffect effect = HapticEffect.Pulse;
float lengthScale = 1.0f;
float frequencyScale = 1.0f;
float amplitudeScale = 1.0f;

controller.TriggerHaptics(effect, lengthScale, frequencyScale, amplitudeScale);