Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
Include |
#include "Kismet/GameplayStatics.h" |
Source |
/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp |
static UAudioComponent * SpawnSound2D
(
const UObject * WorldContextObject,
USoundBase * Sound,
float VolumeMultiplier,
float PitchMultiplier,
float StartTime,
USoundConcurrency * ConcurrencySettings,
bool bPersistAcrossLevelTransition,
bool bAutoDestroy
)
This function allows users to create Audio Components with settings specifically for non-spatialized, non-distance-attenuated sounds. Audio Components created using this function by default will not have Spatialization applied. Sound instances will begin playing upon spawning this Audio Component.
Not Replicated.
An audio component to manipulate the spawned sound
Parameter |
Description |
---|---|
Sound |
Sound to play. |
VolumeMultiplier |
A linear scalar multiplied with the volume, in order to make the sound louder or softer. |
PitchMultiplier |
A linear scalar multiplied with the pitch. |
StartTime |
How far in to the sound to begin playback at |
ConcurrencySettings |
Override concurrency settings package to play sound with |
PersistAcrossLevelTransition |
Whether the sound should continue to play when the map it was played in is unloaded |
bAutoDestroy |
Whether the returned audio component will be automatically cleaned up when the sound finishes (by completing or stopping) or whether it can be reactivated |