From fa43f61fee35725c39b04cc44c3d39c52773379d Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Sat, 11 May 2024 20:41:37 +0100 Subject: [PATCH] Bugfix Dialogue Not Playing Past Beginning Dialogue --- .../DialogueSystem/AC_PlayerDialogueInterpreter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EndlessVendetta/Source/EndlessVendetta/DialogueSystem/AC_PlayerDialogueInterpreter.cpp b/EndlessVendetta/Source/EndlessVendetta/DialogueSystem/AC_PlayerDialogueInterpreter.cpp index 25145c42..2e20ce29 100644 --- a/EndlessVendetta/Source/EndlessVendetta/DialogueSystem/AC_PlayerDialogueInterpreter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/DialogueSystem/AC_PlayerDialogueInterpreter.cpp @@ -59,8 +59,10 @@ void UAC_PlayerDialogueInterpreter::StartDialogue(UDialogueTree* DialogueTree) CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking); OnStartDialogue.Broadcast(CurrentTextNode); if (IsValid(CurrentTextNode->DialogueVoiceOver)) + { CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D( GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false); + } if (APlayerController* PlayerController = GetWorld()->GetFirstPlayerController()) { @@ -94,6 +96,8 @@ void UAC_PlayerDialogueInterpreter::NextDialogue() CurrentTextNode = Cast(CurrentTextNode->ChildrenNodes[0]); CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking); OnNextDialogue.Broadcast(CurrentTextNode); + CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D( + GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false); CurrentChoiceNode = nullptr; CurrentAddItemNode = nullptr; }