const bool Hit = UKismetSystemLibrary::SphereTraceMultiForObjects(GetWorld(),StartSphere,EndSphere,Radius,
objectTypesArray,false,
ActorsToIgnore,EDrawDebugTrace::Persistent,HitArray,true,FLinearColor::Gray,
FLinearColor::Blue,5.f);
if(Hit)
{
TSet<AActor*> AlreadyDamageActors;
for(const FHitResult HitResult : HitArray)
{
AActor* HitActor = HitResult.GetActor();
AlreadyDamageActors.Add(HitActor);
for(AActor* Actor : AlreadyDamageActors)
{
GEngine->AddOnScreenDebugMessage(-1,5.f,FColor::Orange,FString::Printf(TEXT("Hit %s"),*Actor->GetName()));
}
}
iam calling the code on AnimNotifyState Using the receivedTickFunction what iam trying to do with this line of code is hit multiple targets but only once each any help will be appreciated thanks for your time