The Distance
property of the BaseSoundComponent
class represents the distance at which the sound is heard. This property is used to control how sound attenuates over distance, allowing for more realistic audio effects in a 3D environment.
The Distance
property of the BaseSoundComponent
class represents the distance at which the sound is heard. This property is used to control how sound attenuates over distance, allowing for more realistic audio effects in a 3D environment.
To use the Distance
property, you can set it to a float
value that represents the desired distance for sound attenuation. This property is particularly useful when you want to override the default distance attenuation settings for a specific sound component.
// Example of setting the Distance property BaseSoundComponent soundComponent = new BaseSoundComponent(); soundComponent.Distance = 50.0f; // Set the distance to 50 units