Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Budde88 on March 09, 2016, 01:51:05 PM
-
I've been working with Playmaker and Player Prefs for over 2 years now, and I have never run into this issue.
I have 1 Player Pref that just won't have it's Data Erased, everything else erases just fine. Its an INT Pref, does anyone have an idea of what may be the cause? I tried to delete it specifically by it's Key name, just won't delete the data.
Thanks in advance
-
Never had that issue but when working with player prefs this asset will make it easier to debug as you can see the Player pref changes in the editor during runtime https://www.assetstore.unity3d.com/en/#!/content/7070
-
Thanks, but the last thing I need is another plugin.
I would really love a reply from the Devs about this, it is such an odd occurence. I just want to know what could possibly cause an issue like this.
-
Hi,
I never had this issue neither, but i think this is a unity issue.
You should try to search their forum and/or post the issue there also.
-
Hi,
It's typical actually: I think it's most likely a logical issue. Everytime I had such problem, it turned out I was saving prefs straight away after having deleted it, or similar glitch in logic when reading, accessing clearing, initializing prefs.
When I have this problem, I edit the playerpref action to put some debug log, you'll see clearly what prefs get accessed, how and when.
Bye,
Jean
-
Thanks Jean,
I guess I will look into it like that, it's most probably what's happening.
I mean it's only happening on that 1 Player pref, so hopefully I will track it down.
-
FOUND IT!
Not more than 2 minutes after your reply Jean.
It was exactly as you mentioned above, learned something new today :)
-
Yep :)
That's way asking to others is always good, hence the "there is no stupid question" moto :) it forces the brain to actually formulate the problem to others which then makes it easier to solve, else you stay within a locked frame of thinking that is too narrow.
Bye,
Jean
-
A little quest about delete playerprefs.
the action works, but I have to stop and restart the project on Unity.
There is a way to delete and update without out of the game? Some type of refresh.
-
Hi.
The changed data on your variables will not change by deleting playerprefs.
You could use 'set fsm' action and set the default data on variables.
-
Thank you DJ! -> The changed data on your variables will not change by deleting playerprefs.
What I do:
(https://amoraleite.files.wordpress.com/2019/04/captura-de-tela-2019-04-03-c3a0s-09.12.43.png)
-
Hi.
Ah yes that will work also as all variables will be reset to their default state :)
Thanks for sharing your solution!