I have a snipercharge for which I need to have a loop after the initial sound stopped playing. It does that (after a short delay for whatever reason) but the new sound plays in the middle of the map and not on the character.
AShodonCharRaidon::AShodonCharRaidon()
:Super()
{
RaidonChargeAudioComponent->OnAudioFinished.AddDynamic(this, &AShodonCharRaidon::RaidonChargeEnd);
}
void AShodonCharRaidon::RaidonChargeEnd()
{
ServerMulticastOnFireChargeLoopSoundEffect();
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("ey"));
}
void AShodonCharRaidon::MulticastOnFireChargeLoopSoundEffect_Implementation()
{
if (this)
{
if (FireSound != NULL)
{
this->RaidonChargeLoopAudioComponent->Play();
//GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("ey"));
//UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
}
}
}
void AShodonCharRaidon::ServerMulticastOnFireChargeLoopSoundEffect_Implementation()
{
MulticastOnFireChargeLoopSoundEffect();
}
bool AShodonCharRaidon::ServerMulticastOnFireChargeLoopSoundEffect_Validate()
{
return true;
}