float Distance { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Distance property of the SoundEvent class specifies the maximum distance, in units, from which the sound can be heard. This property is crucial for determining how far the sound will propagate in the game environment, affecting the player's auditory experience.

Usage

To use the Distance property, you can get or set its value to control how far the sound can be heard. This property is part of the DistanceAttenuation toggle group, meaning it is relevant when distance attenuation is enabled.

Example usage:

SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.Distance = 100.0f; // Set the sound to be heard from 100 units away

Example

SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.Distance = 100.0f; // Set the sound to be heard from 100 units away