Audio
Sound brings your HELIX world to life. The audio system supports 2D sounds (music, UI feedback), 3D spatial audio (footsteps, gunshots, engines), and ambient soundscapes. Under the hood, HELIX leverages Unreal Engine 5's MetaSounds for high-quality, procedural audio.
Playing Sounds
Create a Sound instance with the bIs2D parameter set to true for non-spatial audio like UI clicks or background music.
- Blueprint
- Lua
- JavaScript
// Play a UI click sound (2D, non-spatial)
ASound* ClickSound = Sound::Spawn(
FVector(0, 0, 0),
"/Engine/VREditor/Sounds/UI/Click",
true, // bIs2D
true, // bAutoDestroy
0.8f, // Volume
1.0f // Pitch
);
-- Play a UI click sound (2D, non-spatial)
local click_sound = Sound(
Vector(0, 0, 0),
"/Engine/VREditor/Sounds/UI/Click",
true, -- bIs2D
true, -- bAutoDestroy
0.8, -- Volume
1.0 -- Pitch
)
// Play a UI click sound (2D, non-spatial)
const clickSound = new Sound(
new Vector(0, 0, 0),
"/Engine/VREditor/Sounds/UI/Click",
true, // bIs2D
true, // bAutoDestroy
0.8, // Volume
1.0 // Pitch
);
3D Spatial Audio
For sounds that should come from a specific place in the world, use 3D audio by setting bIs2D to false. Players will hear them louder as they get closer and from the correct direction based on their position and orientation. You configure the inner radius and falloff distance for attenuation.
- Blueprint
- Lua
- JavaScript
// Spawn a 3D spatial sound at a location
ASound* Explosion = Sound::Spawn(
FVector(2000, 500, 0),
"/Game/Sounds/Explosion",
false, // bIs2D (false = 3D spatial)
true, // bAutoDestroy
1.0f, // Volume
1.0f, // Pitch
400, // Radius (inner attenuation)
5000 // FalloffDistance
);
-- Spawn a 3D spatial sound at a location
local explosion = Sound(
Vector(2000, 500, 0),
"/Game/Sounds/Explosion",
false, -- bIs2D (false = 3D spatial)
true, -- bAutoDestroy
1.0, -- Volume
1.0, -- Pitch
400, -- Radius (inner attenuation)
5000 -- FalloffDistance
)
// Spawn a 3D spatial sound at a location
const explosion = new Sound(
new Vector(2000, 500, 0),
"/Game/Sounds/Explosion",
false, // bIs2D (false = 3D spatial)
true, // bAutoDestroy
1.0, // Volume
1.0, // Pitch
400, // Radius (inner attenuation)
5000 // FalloffDistance
);
Once created, you can control playback with Play, Stop, FadeIn, FadeOut, SetPaused, and adjust properties like SetVolumeMultiplier and SetPitchMultiplier.
Ambient Soundscapes
For background atmosphere — wind, birds, rain — you can place ambient sound emitters throughout your world. These blend together as players move through different areas, creating a rich audio landscape.
The distance parameter on spatial sounds controls the falloff radius. Use larger values (10,000+ cm) for ambient emitters that should cover a wide area, and smaller values for precise effects like a crackling campfire.
MetaSounds in UE5 lets you build procedural audio graphs that react to game parameters in real time. This is perfect for dynamic engine sounds, weather audio, or adaptive music that responds to gameplay intensity.