UGameplayStatics::PlayDialogueAtLocation
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Plays a UDialogueWave at a fixed world location with spatialization and attenuation. Fire-and-forget — no component is returned, so playback cannot be stopped early.
Caveats & Gotchas
- • No replication is performed; in multiplayer sessions, ensure this is called on each client independently or via a multicast RPC.
- • An overload without the Rotation parameter exists as a convenience wrapper; prefer the explicit-rotation version for directional sources.
- • If the FDialogueContext cannot resolve a SoundBase (e.g. the speaker voice is null), the call is silently skipped.
Signature
static ENGINE_API void PlayDialogueAtLocation(const UObject* WorldContextObject, class UDialogueWave* Dialogue, const FDialogueContext& Context, FVector Location, FRotator Rotation, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f, USoundAttenuation* AttenuationSettings = nullptr) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to obtain the world context. | — |
| Dialogue | class UDialogueWave* | The dialogue wave asset to play. | — |
| Context | const FDialogueContext& | Speaker and target context to resolve the audio variation. | — |
| Location | FVector | World-space position to play the dialogue at. | — |
| Rotation | FRotator | Orientation of the dialogue source. | — |
| VolumeMultiplier | float | Linear scalar applied to the volume. | 1.f |
| PitchMultiplier | float | Linear scalar applied to the pitch. | 1.f |
| StartTime | float | Offset in seconds into the dialogue to begin playback. | 0.f |
| AttenuationSettings | USoundAttenuation* | Optional attenuation override asset. | nullptr |
Return Type
void Example
Play spatialized NPC bark at actor location C++
FDialogueContext Ctx;
Ctx.Speaker = NPCVoice;
Ctx.Targets.Add(PlayerVoice);
UGameplayStatics::PlayDialogueAtLocation(
this, BarkWave, Ctx,
GetActorLocation(), GetActorRotation(),
1.f, 1.f, 0.f, AttenuationAsset); Tags
Version History
Introduced in: 4.9
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?