- Home /
PlayerPrefs Name + String, is this possible?
Hi,
I have Google Play Services implemented with my app, but I have an issue.
For saving I'm using PlayerPrefs then getting that score and sending it to the Google Play Leaderboards using the profile that the player is logged in with. The problem is that the total score is saving locally so when another player on the same device logs in with a different account it grabs the same total score that was previously tracked and submitted to the Total Score Leaderboard.
So my question is can PlayerPrefs save dynamic names like the below? Using JS. It doesn't seem to be saving the name to the playerName. It's still grabbing the same local "Total Score" rather than "Total Score John Doe". How would you add a name to the score so it's only that player's high score only saving locally?
playerName = //NameGotFromServer John Doe
totalScore = PlayerPrefs.GetInt("Total Score" + playerName);
PlayerPrefs.SetInt("Total Score" + playerName, totalScore);
GooglePlayManager.instance.submitScore (LEADERBOARD_NAME_SCORE, totalScore); //Score sent to server
Thanks in advance.
Your answer
Follow this Question
Related Questions
Saving PlayerPrefs in Google Chrome NaCl 0 Answers
google play services: picking a random user? 0 Answers
Saving with PlayerPrefs? How it works? 1 Answer
Saving and loading game with PlayerPrefs 1 Answer
Having issues with PlayerPrefs... 2 Answers