float FrequencyScale { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The FrequencyScale property of the HapticEffect class is a float value that determines the scaling factor for the frequency of the haptic effect. This property allows you to adjust the intensity of the frequency component of the haptic feedback, providing a way to fine-tune the sensation experienced by the user.

Usage

To use the FrequencyScale property, you need to have an instance of the HapticEffect class. You can then get or set the FrequencyScale to modify the frequency intensity of the haptic effect. A higher value will increase the frequency, making the effect feel more intense, while a lower value will decrease it.

Example

// Create a new instance of HapticEffect
HapticEffect hapticEffect = new HapticEffect();

// Set the frequency scale to 1.5 to increase the frequency intensity
hapticEffect.FrequencyScale = 1.5f;

// Retrieve the current frequency scale
float currentFrequencyScale = hapticEffect.FrequencyScale;

// Output the current frequency scale
// Note: Avoid using Console.WriteLine in Sandbox environment
// Use appropriate logging or debugging methods instead
// Debug.Log($"Current Frequency Scale: {currentFrequencyScale}");