Audio component found at runtime not during fire event

Hey all,

I am having an issue with my AudioComponent after the first shot from myself and the AI I get a handled ensure event for the component the sound does still play though here is the Source For those who don’t wanna look though everything here is the AimingComponent methods .h `void FindAudioComponent();

bool FireSound = false;

UPROPERTY()
UAudioComponent* AudioComponent = nullptr;

.cppvoid UTankAimingComponent::FindAudioComponent()
{
AudioComponent = GetOwner()->FindComponentByClass();

if (!ensure(AudioComponent)){ return; }

}
if (FireState == EFiringStatus::Locked)
{
//UE_LOG(LogTemp, Warning, TEXT(“FIRE!”));

	if (!FireSound)
	{
		if (!ensure(AudioComponent)) { UE_LOG(LogTemp, Error, TEXT("Audio Component not found down stack")); return; }
		AudioComponent->Play();
	}` the FindAudioComponent method is defined in tick and begin play.

I have fixed this by adding this to my initialise .cpp AudioComponent = AudioComponentToSet .h UAudioComponent* AudioComponentToSet this has the side effect of playing the sound at runtime so I added AudioComponent->SetPaused(true) inside initalise and AudioComponent->SetPaused(false) before the play method