Hey there, I was checking out this post with Josh Markiewicz talking about the matter,
and I’ve created my own playerstate and am leveraging CopyProperties on the playerstate
and performing a serverTravel, however, the client doesn’t seem to get his playerstate once the map changes.
Here are the relevant bits.
The player state cpp –
void ASpellBinderPlayerState::CopyProperties(APlayerState* PlayerState)
{
Super::CopyProperties(PlayerState);
ASpellBinderPlayerState* PState = Cast<ASpellBinderPlayerState>(PlayerState);
if (PState)
{
PState->EquippedItemIds = EquippedItemIds;
}
}
And the gameMode ServerTravel
void ASpellBinderGameMode::ServerTravel(FString FullyQualifiedLevelName)
{
if (Role == ROLE_Authority)
{
UWorld* World = GetWorld();
if (World)
{
bUseSeamlessTravel = true;
World->ServerTravel(FullyQualifiedLevelName);
}
}
}
If I’m doing something fundamentally wrong, I’d appreciate a push in the right direction.