I was following the multiplayer tutorial and trying to have the player take damage.
So I added this in my PlayerController.h:
UFUNCTION()
float TakeDamage(AActor* DamagedActor, float Damage, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser);
in my cpp file:
void AWhyMePlayerController::BeginPlay()
{
Super::BeginPlay();
GetOwner()->OnTakeAnyDamage.AddDynamic(this, &AWhyMePlayerController::TakeDamage);
}
float AWhyMePlayerController::TakeDamage(AActor* DamagedActor, float Damage, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser)
{
float damageApplied = _currentHealth - Damage;
SetCurrentHealth(damageApplied);
return damageApplied;
}
When I try to build I get the following compile error: No instance of function template
However, I copied the function declaration from AActor