🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

[HELP ME] Unity HTML5 + Playerprefs vs Updates

A topic by Alfred Alves created 15 days ago Views: 46 Replies: 3
Viewing posts 1 to 3

Hi, I'm developing a, HTML5 game that uses playerprefs to store data. It works perfectly.

BUT

I want to keep updating the game based on feedback and stuff like that, and when I generate a new build of the game and upload it to the game page, the playerprefs get lost and the player loses all progress.

Does anyone know if there is a way to upload a new build without losing the playerprefs saved data?

I already tried saving it with the same name, but it always resets everything.

halp pls

Moderator(+1)

That's likely because the path to the game changes every time you upload a new version. This also breaks embeds, by the way. I'm not aware of any fix.

(Edited 1 time)

Yeah, it looks like there's no way to fix this... I'm looking for an alternative way to save data.

For those who find this post after searching this problem on google, I'll be editing this answer to include any interesting stuff I find.

I'm currently trying to follow this -> https://unity3d.com/de/learn/tutorials/topics/scripting/persistence-saving-and-l... It's kinda old but I think it still works in newer unity versions. This doesn't work because it involves creating a file and, for security reasons, WebGL is not able to write files. (It's still a good way to save files on other platforms though).

I'm still searching for PlayerPrefs alternatives.

Admin(+1)

This is a known issue but we don't have any solution right now. The way we do our CDN and caching means that new uploads get entirely new URLs. If you make any progress on getting saves to work across URL changes please tell us, I'd like to write up a guide for other that have the same problem. Thanks