Description
The Falloff
property in the BaseSoundComponent
class represents the curve used to determine how the sound attenuates over distance. This property is part of the DistanceAttenuationOverride
group, allowing for customization of how sound diminishes as it moves away from the listener.
Usage
To use the Falloff
property, you can assign a Curve
object that defines the attenuation behavior. This is useful when you want to customize how sound fades out over distance, providing a more realistic or tailored audio experience in your game.
Example
// Example of setting the Falloff property
var soundComponent = new BaseSoundComponent();
soundComponent.Falloff = new Curve();
// Configure the curve as needed
soundComponent.Falloff.AddKey(0, 1); // At distance 0, volume is 100%
soundComponent.Falloff.AddKey(10, 0); // At distance 10, volume is 0%