Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: OddButAwesome on October 19, 2015, 11:48:28 AM

Title: Player Prefs not saving High Score after Application Quit
Post by: OddButAwesome on October 19, 2015, 11:48:28 AM
Hi all,

Having an issue as per the subject line.

I have a button in the top right X that has the FSMs as follows:
- Check Button
- Player Prefs Set High
- Quit Application.

While the game is running the high score is displayed and updated correctly whenever a new score beats it. When I quit using the X button or task switch and restart the game the score is set to 0.

Can anyone see something wrong in my setup?

Thank you.
Title: Re: Player Prefs not saving High Score after Application Quit
Post by: Cyborg_Sam on October 19, 2015, 11:52:26 AM
Hi

I have been trying to work this out for the past week!
Hopefully someone can point us in the right direction :)

 
Title: Re: Player Prefs not saving High Score after Application Quit
Post by: OddButAwesome on October 19, 2015, 12:01:30 PM
Hi Cyborg_Sam,

I was just looking at your post on the similar issue :).

I got my high score to save across scenes (Gameplay, MainMenu) by using a Global Variable to store the score. Not sure if this makes a difference or not and it looks like you are using a totally different system with the txt file but maybe it may help you.

I am still learning the ropes with PM.

Cheers
Title: Re: Player Prefs not saving High Score after Application Quit
Post by: djaydino on October 20, 2015, 01:26:05 AM
Hi,
on your playerprefs Action take out the global from the key value and name them (for example) CurrentHiSave.

atm your global/currenthighSTRING is changing value and playerprefs can't find your save

the "key value" is to find your playerprefs save value
Title: Re: Player Prefs not saving High Score after Application Quit
Post by: OddButAwesome on October 20, 2015, 01:33:24 AM
Thank you djdino!

I will give that a shot.