Audio Component Play not working

Good point, unsure about this. I made a music player once as a GameInstanceSubsystem but I just realized I use CreateSound2D to play the audio.

UObject* WorldContext = GetOuter()->GetWorld();
Sound->VirtualizationMode = EVirtualizationMode::PlayWhenSilent;

AudioComponent = UGameplayStatics::CreateSound2D(WorldContext, Sound, 1.0f, 1.0f, 0.0f, nullptr, true, false);

I don’t use CreateDefaultSubobject or SetupAttachment there, I simply have an array of structs and each struct holds an UAudioComponent pointer among some other data.

3 Likes