the server goes though all this code but the client can get to the take damage function. Would it be because the take damage function only works on server, and if so the replicated attack function should do it right???
void MyCharacter::Attack_Implementation()
{
// does raycast and calls take damage function on hit actor
}
void MyCharacter::TakeDamage()
{
const float ActualDamage = Super::TakeDamage(Damage, DamageEvent, EventInstigator, DamageCauser);
HandleHealth(ActualDamage);
return ActualDamage;
{
void MyCharacter::HandleHealth_Implementation(float DamageAmount)
{
Health -= DamageAmount;
if (Health <= 0.0f)
{
Die();
}
{
void AHero2Character::Die_Implementation()
{
// stop character moving
}