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;
.cpp
void 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.