Just hard to understand Server-Client things in Unreal Engine,
When i set up the editor like this, “Play As Client and Number of Players = 1”
‘HasAuthority’ functions work well in Blueprint.
As you see.
But in the CPP, ‘HasAuthority’ always returns false.
void AMyCharacter::ServerDestroyThisCharacter_Implementation()
{
if (HasAuthority())
{
if (IsValid(this))
{
Destroy();
}
}
}
If there’s a code like this, HasAuthority phrase never passed.
Actually, Destroy function checks the Authority Role and replicated internally,
so the Destroy function never completed either.
Is this normal ?
If so, we don’t need to test in the editor as client mode if we are making multiplayer games, do we?
Sombody help me to understand these thing fully T^T