// Copyright Epic Games, Inc. All Rights Reserved. #include "AudioVideoRecordGameMode.h" #include "Kismet/GameplayStatics.h" #include "Components/AudioComponent.h" AAudioVideoRecordGameMode::AAudioVideoRecordGameMode() { } void AAudioVideoRecordGameMode::BeginPlay() { Super::BeginPlay(); if (BGMSound) { BGMAudioComponent = UGameplayStatics::SpawnSound2D(this, BGMSound, BGMVolume); if (BGMAudioComponent) { BGMAudioComponent->bAutoDestroy = false; } } }