- Home /
Why is this not saving to player prefs and loading (Works in editor only)
I'm trying to save a string from an array into player prefs but for some reason it only wants to work in the editor. Help!!
This is my save method:
PlayerPrefs.SetString("CharacterToRemb", CharsToRemember[0] = sresult);
This in my reload method:
CharsToRemember[0] = PlayerPrefs.GetString("CharacterToRemb");
ONLY WORK IN THE EDITOR???
EDIT! So as it turns out the save and load method as near as I can tell are working OK but now this is the strange part that will REALLY BAKE YOUR BRAIN. I set up buttons to do the job of my VR inputs and strangely the buttons work but my VR inputs don't despite the fact that both input methods are calling and accessing the exact same public voids.
Why on earth this is the case is a real brain baker!!
Thoughts people, thoughts???!!!???
Lets see if any of you Braniacs have an answere for that little slice ;)
Based on the info it seems it has nothing to do with PlayerPrefs but ins$$anonymous$$d with your VR input. Is the function called more than once? Have you put breakpoints / prints in the code to see if it is definitely called?
Thanks @Ivovd$$anonymous$$arel Well the VR inputs are definitely being called, I was able to figure out what the problem was, turn out on my VR calls it was set to look for a bool that was supposed to be false but I had it set in my if statement as true. But now that is working it lead me to an even stranger issue lol seems there is always something. Now what happens is if I use my VR inputs it reads the characters being called twice and sometimes multiple times even thought the character was read only once. No idea why that is happening but I guess that would be a whole new question to post about.... jeepers creepers :/
Got it, just had to reboot the computer and now it's all working flawlessly :)
Your answer
Follow this Question
Related Questions
How do I save and load a 2D array? 1 Answer
save string from array to player prefs 1 Answer
PlayerPrefs not saving mission info at all. 0 Answers
Using playerprefs to remember a level completion 1 Answer
Saving Data for a Multiplayer Game 1 Answer