I have checked my code against final version in the lecture and deleted Binaries, Intermediate and Saved folders and restarted/rebuilt the project, however the ReplicatedVar will not replicate.
It is updated properly (in/from the listen server only), but the client does not pick up the change.
Only error in the output log is:
LogPackageName: Warning: DoesPackageExist called on PackageName that will always return false. Reason: Input ‘’ was empty.
class MULTIPLAYER_API AMyBoxActor : public AActor
{
// …
UPROPERTY(Replicated, BlueprintReadWrite) float ReplicatedVar;
void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override;
};
AMyBoxActor::AMyBoxActor()
{
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
ReplicatedVar = 100.f;
}
void AMyBoxActor::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMyBoxActor, ReplicatedVar);
}