Persisted Player Data
Last updated
Last updated
Persisted Player Data was created for your game to save progress and data related to each unique player of your game that can be retrieved in the future even after they leave and rejoin your game. This is useful for things like player progression systems, lifetime stats tracking, player quest completion and unlocks, and so much more.
The Persisted Player Data system builds on top of the Persisted Data concepts and exposes a number of convenience methods for retrieving and updating player data.
Any JSON compatible data can be stored for a player. Typically, the best practice is to use a single object with many arbitrary properties that reflect the data you want to track for a player for your game.
You can learn more about supported data type here:
You can retrieve player data by using the player.getPersistedData()
method. Any instance of a player object has this available.
Here's an example of a common usage pattern of retrieving a player's data when they join a game.
Here's an example of using this.
Similar to retrieving player data, you can set or update player data, which utilizes , using the player.setPersistedData()
method. Any instance of a player object has this available.