USoundCue
#include "Sound/SoundCue.h" Description
A graph-based audio asset that combines SoundWaves with nodes for mixing, randomization, looping, pitch modulation, and sequencing. Accepted anywhere USoundBase is used.
Caveats & Gotchas
- • SoundCues have higher playback overhead than raw USoundWave due to graph traversal. For simple one-shot sounds without variation, prefer USoundWave directly.
- • Duration and MaxDistance are cached at load by CacheAggregateValues(). If the graph is modified at runtime (rare), call it manually to refresh the cache.
- • bPrimeOnLoad loads all referenced SoundWaves into the stream cache when the cue loads. This avoids first-play hitches but can spike memory on map load — use selectively.
Example
Play a sound cue with randomized variation C++
// FootstepCue contains a Random node selecting from multiple USoundWaves
UGameplayStatics::PlaySoundAtLocation(this, FootstepCue, GetActorLocation()); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?