Allow saving in OnPlayerLeft
BoatFloater
Although it would still be best practice to save data periodically, it would be a nice quality of life feature to have one final opportunity to save as the player leaves. Please allow us to save data in OnPlayerLeft
OR
provide a new event before OnPlayerLeft to the local player which would allow us an opportunity to save any data.Log In
Vincil
First thing to consider, at least in the current version as presented in the documentation, Player Data already auto saves. A Player Object with continuous sync mode will also auto save. And for a Player Object with manual sync mode, if you're not saving on the same frame you're changing it there is probably a good reason you're not uploading the changed value.
So if you're asking for code on a local client to be run before they are allowed to leave to gather all the data that hasn't already been reported to Player Data, that would likely require allowing a world to forcibly prevent players from disconnecting which would be a strong ask.
Matisan
Vincil Rather than forced to stay, could just be a quick prompt when a player tries to leave that there is unsaved progress and if they would like to save before leaving, but still free to leave anytime
Tom Leylan
OnPlayerLeaving with a complete intact player object would be nice.
Happyrobot33
the sad problem with this is that persistence doesnt upload at any different of a rate compared to normal udon sync. So either they would have to make the upload rate really high, or cap the ammount you can save on a event like this, otherwise user experience would be degraded :/
Or I guess they could cache the data and do it in the background but that wouldnt be trivial to do either