00:00
00:00
Newgrounds Background Image Theme

StickmanMarkinson just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Unity WebGL game PlayerPrefs and NG

930 Views | 5 Replies
New Topic Respond to this Topic

Hello dear unity developers! I have a problem with using PlayerPrefs in NewGrounds. Its okay until i'm updating the game. Every data stored becomes lost. How can i fix that? I really want to update my game.

Response to Unity WebGL game PlayerPrefs and NG 2020-01-13 20:45:38


I ran into the same problem, so I'ma add my question to this thread even though it's years old:


I've tweaked my Unity game after I uploaded it to NG for testing before publishing, and when I update it I lose any saved game data (stored in PlayerPrefs) from when I was playtesting it in NewGrounds' preview mode. It's no big deal while I'm just playtesting, but if there are any bugs that get noticed after the game is published does anyone know if there's a way to upload an updated version of the game while preserving the data in PlayerPrefs so I don't wipe out everyone's progress by updating?


My newsfeed has random GameDev tips & tricks


Holy smokes I just found out how to handle this problem. Not only does it not wipe out saves when you update a game, it could potentially be used to do other cool things like let you create a series where you use save data from previous episodes in later installments of the series. Hell, you could probably even have a bunch of Unity devs form a collab where all of their games interact with each other.


Is there an appropriate mod who I should contact to describe my approach to and make sure it's cool with you guys, and see whether you'd want to implement it in the Unity version of the Newgrounds.io API? I think it would take a little tweaking beyond what I've done but probably not much.


My newsfeed has random GameDev tips & tricks

Response to Unity WebGL game PlayerPrefs and NG 2020-01-17 00:37:41


Really? What approach are you using? I'm interested in this as well, since saving via PlayerPrefs is a simple and pretty convenient to do it, in comparison with, let's say, generating a save string or exporting a save file. You can find similar posts discussing this issue on other sites, but I didn't really find a good answer.


As for the appropriate mod, you probably should ask @PsychoGoldfish.

Response to Unity WebGL game PlayerPrefs and NG 2020-01-17 03:06:11


At 1/17/20 12:37 AM, Rallyx wrote: Really? What approach are you using? I'm interested in this as well, since saving via PlayerPrefs is a simple and pretty convenient to do it, in comparison with, let's say, generating a save string or exporting a save file. You can find similar posts discussing this issue on other sites, but I didn't really find a good answer.

As for the appropriate mod, you probably should ask @PsychoGoldfish.


Thanks Rallyx, I PMed him with a description and will see what he says about going ahead and implementing it and letting everyone do it.


My newsfeed has random GameDev tips & tricks

Response to Unity WebGL game PlayerPrefs and NG 2020-02-18 11:01:10


At 1/17/20 12:37 AM, Rallyx wrote: Really? What approach are you using? I'm interested in this as well, since saving via PlayerPrefs is a simple and pretty convenient to do it, in comparison with, let's say, generating a save string or exporting a save file. You can find similar posts discussing this issue on other sites, but I didn't really find a good answer.

As for the appropriate mod, you probably should ask @PsychoGoldfish.


Ok now that the Phaser Game Jam is done I finally got off my ass and posted it here

https://3p0ch.newgrounds.com/news/post/1086279

I tried posting it in the Game Dev forum but it was telling me it was too large to post there even if I shaved it down to be under the character limit... if this would be of general interest to a lot of Unity devs I might make a short post in that forum linking to the news post because I don't think many people will look for it in this forum.


My newsfeed has random GameDev tips & tricks