I am having a troubling issue with null components during runtime. I have declared 3 FMOD Audio Components exactly the same way, and initialized them exactly the same way, however at runtime the only valid component is the ItemAudioComp.
Is there some kind of limitation in FMOD that stops me from creating multiple audio components on the same actor? Is this an engine limitation? I’ve never run into anything like this before.
.h:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UFMODAudioComponent* DialogueAudioComp;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UFMODAudioComponent* ItemAudioComp;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UFMODAudioComponent* BarkComponent;
.cpp:
BarkComponent = CreateDefaultSubobject<UFMODAudioComponent>(TEXT("BarkAudioComp"));
BarkComponent->SetupAttachment(RootComponent);
DialogueAudioComp = CreateDefaultSubobject<UFMODAudioComponent>(TEXT("DialogueAudioComp"));
DialogueAudioComp->SetupAttachment(RootComponent);
ItemAudioComp = CreateDefaultSubobject<UFMODAudioComponent>(TEXT("ItemAudioComp"));
ItemAudioComp->SetupAttachment(RootComponent);
EDIT: In an attempt to determine whether the issue was a limitation of the number of components I removed the ItemAudioComponent. Instead of seeing one of the others I see none.
Another test: The other two components (null ones) were used elsewhere in CPP (not destroyed anywhere) So I added a simple call to play on BeginPlay for the ItemAudioComponent and it was still valid within the editor.