Okay AnDarra, try this:
AEnemyActor * EActor; //Create a variable, which is a pointer to a AEnemyActor class
if(HitResults->GetActor() )
{
if( Cast<AEnemyActor>(HitResults->GetActor()) )
{
EActor = Cast<AEnemyActor>(HitResults->GetActor());
EActor->ApplyDamage();
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Applied damage to %s !"), *HitResults->GetActor()->GetName());
}
else
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Could not cast actor %s to AEnemyActor !"), *HitResults->GetActor()->GetName());
}
}
You could get errors, I just typed it on my phone. Let me know how you go.