Description
The DistanceAttenuationOverride
property in the BaseSoundComponent
class is a boolean flag that determines whether the default distance attenuation settings for a sound should be overridden. When set to true
, custom distance attenuation parameters can be specified, allowing for more precise control over how sound diminishes with distance.
Usage
To use the DistanceAttenuationOverride
property, you need to set it to true
if you want to customize the distance attenuation behavior of a sound component. This is useful in scenarios where the default attenuation does not fit the specific needs of your audio design.
Once enabled, you can adjust related properties such as Distance
and Falloff
to fine-tune the attenuation effect.
Example
// Example of using DistanceAttenuationOverride in a BaseSoundComponent
public class CustomSoundComponent : BaseSoundComponent
{
public CustomSoundComponent()
{
// Enable custom distance attenuation
DistanceAttenuationOverride = true;
// Set custom distance and falloff values
Distance = 100.0f; // Maximum distance for sound attenuation
Falloff = new Curve(); // Custom falloff curve
}
}