float OcclusionRadius { get; set; }

robot_2Generated
code_blocksInput

Description

The OcclusionRadius property defines the radius in inches within which the sound's occlusion effect is applied. This property is part of the SoundEvent class, which is used to manage sound events in the Sandbox environment. The occlusion effect simulates how sound is blocked or absorbed by obstacles, providing a more realistic audio experience.

Usage

To use the OcclusionRadius property, you can set it to a value between 0 and 256 inches. This range is enforced by the RangeAttribute, ensuring that the value is clamped within these bounds. The property is part of the Occlusion toggle group, meaning it is only relevant when occlusion is enabled for the sound event.

Example

// Example of setting the OcclusionRadius property
SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.Occlusion = true; // Enable occlusion
mySoundEvent.OcclusionRadius = 100.0f; // Set occlusion radius to 100 inches

// Ensure the UI property is false to make the OcclusionRadius visible
mySoundEvent.UI = false;