I included GameplayStatics.h, tried some variations, but the compiler keeps telling me that the function has no overrides for my set of arguments. I found this video and copied the code at 3:08, but nothing worked.
My cpp:
#include "Kismet/GameplayStatics.h"
...
void AMyActor::MakeSound() {
bool bDoOnce = true;
bool bHit = UKismetSystemLibrary::SphereTraceSingleForObjects(this, ... );
if (bHit && bDoOnce) {
bDoOnce = false;
UGameplayStatics::PlaySoundAtLocation(GetWorld(), Sound, GetActorLocation(), 1.0f, 1.0f, 0.0f);
}
}