I was following the tutor (https://docs.unrealengine.com/zh-CN/…art/index.html) to make a Network game sample, after all the code have been prepared, I wanted to build it for final test. But it displayed the message below:
The function with problem was declared as follows:
// Declaration:
(protected)
UFUNCTION(Server, reliable)
void HandleFire();
// Definition:
void ANetworkTestCharacter::HandleFire()
{
FVector spawnLocation = GetActorLocation() + (GetControlRotation().Vector() * 100.0f) + (GetActorUpVector() * 50.0f);
FRotator spawnRotation = GetControlRotation();
FActorSpawnParameters spawnParameters;
spawnParameters.Instigator = Instigator;
spawnParameters.Owner = this;
ANetworkTestProjectile* spawnedProjectile = GetWorld()->SpawnActor<ANetworkTestProjectile>(spawnLocation, spawnRotation, spawnParameters);
}
After checking the documentions, I realize that this macro functions by making a new function with “_Implitation” added to the end, and the failure message indicates that a duplicated “HandleFire()” was declared, which I double checked with Global Search System in the Vusial Studio and it’s not. The UnrealBuildTool must have forgot to add “_Implitation” to the function name for some reason.
Is this supposed to be a bug, or something I didn’t configure properly?
(By the way, both 4.23.1, 4.24.2 are tested, and “UFUNCTION(Server, unreliable)”, “UFUNCTION(Client, reliable)”, “UFUNCTION(Client, unreliable)” are all tested, all the same.