Function replication not working

anonymous_user_04e6fffe
Sun, 12 Nov 2017 15:12:50 +0000
Multiplayer & Networking

I have recently started adding multiplayer to my project and looked at different guides on replication, variables work well so far i think. Now I started testing implementing functions and they don’t seem to work no matter what guide I use.

AEntity.h

UFUNCTION(Server, Reliable, WithValidation)
void ServerAttack();

##AEntity.cpp##

void AEntity::ServerAttack_Implementation(){
if(!Attacking){
Attacking = true;
}
}

bool AEntity::ServerAttack_Validate(){
return true;
}

ServerAttack_Validate function doesn’t throw any errors while ServerAttack_Implementation keeps throwing errors that it is not a member of AEntity. It throws an error to GENERATED_BODY() saying class “AEntity” has no member “ServerAttack_Implementation”

I have “UnrealNetwork.h” included in the cpp file

6 posts - 1 participant