AFA_Sounds
Sound class hierarchy, attenuation presets and helper libraries. Sets the project's default sound classes and mix.
What it gives you
- A sound class hierarchy wired to the settings volumes
- Attenuation presets from UI to ambient
- Helper macros for playing sound on actors and components
Requires
None
Description
This module defines how audio is organised. The sound class hierarchy — master, music, SFX, UI, voice
— is what the volume settings in AFM_Settings control, and its Engine.ini sets these as the
project's defaults along with the default sound mix.
Attenuation presets cover the common distances: UI, near, medium, far and ambient. Using them keeps spatial audio consistent between systems.
Setup
- Confirm the project's default sound classes point at
SC_Masterand the default mix atSMix_Default.
If your project overrides the default sound class, the framework's volume settings will not apply.
Usage
Playing a sound on an actor
Use ML_Actor_Sound or ML_Comp_Sound so attenuation and sound class are applied consistently.
Choosing attenuation
SA_UI for interface sounds, SA_Near for hand-scale interactions, SA_Medium for object
interactions, SA_Far and SA_Ambient for environment.
Key properties
| Property | When to change |
|---|---|
| Sound class assignment | On your own cues, to route them through the right volume setting |
| Attenuation preset | Match the interaction's physical scale |
Extending
Add your own sound classes as children of SC_Master so they inherit the master volume setting.
Example map
Every interaction sound in the example maps routes through this hierarchy.
Troubleshooting
Volume settings have no effect on my sounds. The cue is not assigned to a sound class under SC_Master.
API reference
Every blueprint asset in this module. Expand an asset to see its members.
Libraries
BFL_Sound2 members
Function library choosing a sound attenuation from how large a thing is: over two metres takes the far setting, over thirty centimetres the medium one, and anything smaller the near one. The sound macro libraries call it, which is how a sound played at an actor's centre carries as far as the actor is big. Call it directly when playing a sound of your own.
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | GetSoundAttenuationFromBoundsSound | (Actor: Actor, __WorldContext: Object, out Attenuation: SoundAttenuation) | Returns an attenuation preset chosen from the size of the actor's bounding box, so a large object carries further than a small one. Convenient when spawning a sound on an actor whose scale is not known in advance. |
| fn | DetermineSoundAttenuationFromRadiusSound | (Radius: float, __WorldContext: Object) → SoundAttenuation | Picks one of the three shipped attenuation presets from a radius in centimetres: near below 30, medium up to 200, far above that. Use it so sounds on objects of very different sizes stay audible over a sensible distance without hand-tuning each one. |
ML_Actor_Sound0 members
Macro library for actor graphs. Play Sound At Center plays a sound at the middle of the actor's bounds and picks the attenuation from how large the actor is, so there is no setting to choose by hand. Available in any Actor blueprint; the component and scene component sound libraries do the same job elsewhere.
No editor-visible members; this asset configures defaults only.
ML_Comp_Sound0 members
Macro library for actor component graphs. Play Sound At Center Of Owning Actor plays a sound at the middle of the owner's bounds, with the attenuation taken from the owner's size. The highlight, the grip interaction and the overlap interaction all play their sounds through it.
No editor-visible members; this asset configures defaults only.
ML_SceneComponent_Sound0 members
Macro library for scene component graphs. Play Sound At Component plays a sound at the component's own world location rather than at the actor's centre, with the attenuation taken from the owner's size. Reach for it where the component's position is what the player should hear, as the connector and the teleport ability do.
No editor-visible members; this asset configures defaults only.