playMaker

Author Topic: Player Prefs not saving High Score after Application Quit  (Read 3607 times)

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Player Prefs not saving High Score after Application Quit
« 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.

Cyborg_Sam

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Player Prefs not saving High Score after Application Quit
« Reply #1 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 :)

 

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Re: Player Prefs not saving High Score after Application Quit
« Reply #2 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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Player Prefs not saving High Score after Application Quit
« Reply #3 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

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Re: Player Prefs not saving High Score after Application Quit
« Reply #4 on: October 20, 2015, 01:33:24 AM »
Thank you djdino!

I will give that a shot.