bool DistanceAttenuation { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The DistanceAttenuation property of the SoundEvent class determines whether the sound should fade out over distance. When enabled, the sound's volume will decrease as the listener moves further away from the sound source, simulating a more realistic audio experience.

Usage

To use the DistanceAttenuation property, simply set it to true if you want the sound to fade out over distance, or false if you want the sound to maintain a constant volume regardless of distance.

Example

// Example of using the DistanceAttenuation property
SoundEvent mySoundEvent = new SoundEvent();

// Enable distance attenuation
mySoundEvent.DistanceAttenuation = true;

// Disable distance attenuation
mySoundEvent.DistanceAttenuation = false;