Hi.
I’m replicating a int32 called “playing” in my game.
However, it sometimes is 0 in Tick, which is really bad since it might cause a delay.
I only set it once every few minutes, so I don’t understand why it would reset to 0.
The server is the one setting the variable.
in cpp
void AMusicSuiteCharacter::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMusicSuiteCharacter, playing);
}
void AMusicSuiteCharacter::Tick(float deltaseconds)
{
Super::Tick(deltaseconds);
UE_LOG(LogTemp, Warning, TEXT("onegaishimasu: %d "), playing);
}
in header
UPROPERTY(replicated)
int32 playing;
any idea how to prevent it from resetting the variable to 0?