Transfer Data From Level to Level in Multiplayer

Hi all,
I have a multiplayer game where players are first gathered in a lobby and then travel to a chosen map. In this map the players earn points and when the game is finished they go back to the lobby.
The lobby is supposed to show how many points each player has, so before going back to the lobby I save the points earned in the game in the game instance and then transfer it to the lobby. The problem is that all the players in the game gets the same number of points.
What would be a good way to save each player’s points and transfer them to the lobby?

The thing is that you are saving the score for each one in the same property server-side GameInstance, overwriting what last player saved, ending up in the same score for all. While you can save it client-side and it will work fine, players then will be able to cheat and change that score, which is bad.

Instead, a good way would be to use the PlayerState and its beloved function CopyProperties. Also, there is a property already there for you called Score which can be used, though it will be reset, unless you make it not to. Of course, you will have to travel them back to the lobby seamlessly.

All of what I said is explained here: Persistent Data Compendium - WizardCell, specifically in last sections, options 1 & 3 respectively.

1 Like